Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Warning] PHP Deprecated: strlen(): Passing null to parameter #1 #189

Open
kekefreedog opened this issue Feb 14, 2022 · 1 comment
Open

Comments

@kekefreedog
Copy link

kekefreedog commented Feb 14, 2022

Hello,

I am using climate with PHP8.1, and I have this log :
PHP Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /Users/Toto/Sites/Sandbox/vendor/league/climate/src/TerminalObject/Basic/BasicTerminalObject.php on line 21

To fix this warning message, I just add this $value && strlen($value) in

protected function set($key, $value)
{
    if ($value && strlen($value)) {
        $this->$key = $value;
    }
}

Is it possible to include this fix in the next release ?

Best

@kekefreedog
Copy link
Author

kekefreedog commented Feb 14, 2022

Same problem here : Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /Users/toto/Sites/LuckyPHP/vendor/league/climate/src

if (strlen($label) > 0) {

Fix :

// If this line has a label then set that this progress bar has a label line
if ($label && strlen($label) > 0) {
    $this->has_label_line = true;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant