bpolaszek/bentools-etl

Warnings when using PHP 8

nclavaud opened this issue ยท 10 comments

Hi ๐Ÿ‘‹

Thank you very much for this lib. I managed to implement a full, custom ETL workflow and all went smoothly.

Using PHP 8, I got those two warnings, though:

PHP Warning:  "resource" is not a supported builtin type and will be interpreted as a class name. Write "\Safe\resource" or import the class with "use" to suppress this warning in vendor/thecodingmachine/safe/generated/sockets.php on line 797
PHP Warning:  "integer" will be interpreted as a class name. Did you mean "int"? Write "\Safe\integer" or import the class with "use" to suppress this warning in vendor/thecodingmachine/safe/generated/swoole.php on line 17

I guess this is because the referenced version of the thecodingmachine/safe lib is quite old.

Hello I am having the same problem in laravel v9.24.0 with PHP 8.1.9 in August 2022
image

Hello ๐Ÿ‘‹

It's been a while I didn't work on this library - are you using version 2.x or 3.x? I'll have a look as soon as possible.

What version of this library are you using?

Hi, I'm Sorry.
image

I was speaking about bentools/etl actually ๐Ÿ™‚

Anybody? I just updated Laravel and this warning shows up on every php artisan command.

Anybody? I just updated Laravel and this warning shows up on every php artisan command.

What version of bentools/etl are you using?

Solution for 1: Open vendor/thecodingmachine/sockets.php in line number 4 add
use resource;

Solution for 2: Open vendor/thecodingmachine/swoole.php in line number 17 replace ''
swoole_async_write(string $filename, string $content, int $offset = null, callable $callback = null): void
insted of swoole_async_write(string $filename, string $content, integer $offset = null, callable $callback = null): void

This will fix your problem! :) @nclavaud

Hello I am having the same problem in laravel v9.24.0 with PHP 8.1.9 in August 2022 image

Solution for 1: Open vendor/thecodingmachine/sockets.php in line number 4 add use resource;

Solution for 2: Open vendor/thecodingmachine/swoole.php in line number 17 replace '' swoole_async_write(string $filename, string $content, int $offset = null, callable $callback = null): void insted of swoole_async_write(string $filename, string $content, integer $offset = null, callable $callback = null): void

This will fix your problem! :) @nclavaud

Not recommended to directly edit your vendor file .

Here is how i fix this issue :

Step One : delete your composer.lock

Step Two : run composer require thecodingmachine/safe

This should solve the issue

Hello I am having the same problem in laravel v9.24.0 with PHP 8.1.9 in August 2022 image

Solution for 1: Open vendor/thecodingmachine/sockets.php in line number 4 add use resource;
Solution for 2: Open vendor/thecodingmachine/swoole.php in line number 17 replace '' swoole_async_write(string $filename, string $content, int $offset = null, callable $callback = null): void insted of swoole_async_write(string $filename, string $content, integer $offset = null, callable $callback = null): void
This will fix your problem! :) @nclavaud

Not recommended to directly edit your vendor file .

Here is how i fix this issue :

Step One : delete your composer.lock

Step Two : run composer require thecodingmachine/safe

This should solve the issue

Thank you! This worked for me! I have php version 8.1.10