You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried the v0.8.0 on one of my project and I got the following error
Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/www/vendor/rskuipers/php-assumptions/src/PhpAssumptions/Cli.php on line 138
I ran the project in a docker container that own a PHP 8.1 version.
After a quick look at \League\CLImate\Argument\Manager::get method, I found out it can return null. As the argument of getPathsFromList is supposed to be a string (read from PHPDoc + inferred from usage in the method), I think a cast should be executed while passing the argument:
Uh oh!
There was an error while loading. Please reload this page.
I tried the v0.8.0 on one of my project and I got the following error
I ran the project in a docker container that own a PHP 8.1 version.
To fix it, the following line :
https://github.com/rskuipers/php-assumptions/blob/master/src/PhpAssumptions/Cli.php#L138
could definitly be replaced by
as the only purpose of the usage of
strlen
here is to check if the string is not empty.EDIT: the only usage I found is actually here:
php-assumptions/src/PhpAssumptions/Cli.php
Line 105 in 10f82ca
After a quick look at
\League\CLImate\Argument\Manager::get
method, I found out it can returnnull
. As the argument ofgetPathsFromList
is supposed to be astring
(read from PHPDoc + inferred from usage in the method), I think a cast should be executed while passing the argument:Indeed, the return type of
\League\CLImate\Argument\Manager::get
isstring|int|float|bool|null
, all of them castable to string.The text was updated successfully, but these errors were encountered: