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

Fix deprecation notices with PHP 8.2. #86

Closed
wants to merge 1 commit into from

Conversation

sebastic
Copy link
Contributor

@sebastic sebastic commented Dec 5, 2022

Dynamic properties are deprecated in 8.2, see: https://wiki.php.net/rfc/deprecate_dynamic_properties

@glo71317
Copy link
Contributor

Guys any plan to merge this PR and also i can see some more depreciation related PHP 8.2

@@ -11,6 +11,7 @@ class Less_Tree_Color extends Less_Tree {
public $alpha;
public $isTransparentKeyword;
public $type = 'Color';
public $name = 'n/a';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not able to reproduce or find how or where this is read or written to. I don't see it in the composer test output on PHP 8.2, and quick analysis doesn't show an obvious place where Color->name takes place.

$ git grep -E '>name =|\bname;' lib/
lib/Less/Parser.php:                if ( $rule->name == $var_name ) {
lib/Less/Parser.php:                    $name = $nameLoop = $val->name;
lib/Less/Parser.php:        $nonVendorSpecificName = $name;
lib/Less/Parser.php:            return $name;
lib/Less/Tree/Call.php: public $name;
lib/Less/Tree/Call.php:     $this->name = $name;
lib/Less/Tree/Directive.php:    public $name;
lib/Less/Tree/Directive.php:        $this->name = $name;
lib/Less/Tree/Mixin/Definition.php: public $name;
lib/Less/Tree/Mixin/Definition.php:     $this->name = $name;
lib/Less/Tree/NameValue.php:    public $name;
lib/Less/Tree/NameValue.php:        $this->name = $name;
lib/Less/Tree/Rule.php: public $name;
lib/Less/Tree/Rule.php:     $this->name = $name;
lib/Less/Tree/Rule.php:     $name = $this->name;
lib/Less/Tree/Rule.php:             $this->name = $name;
lib/Less/Tree/Variable.php: public $name;
lib/Less/Tree/Variable.php:     $this->name = $name;
lib/Less/Tree/Variable.php:         $name = $this->name;
lib/Less/Visitor/toCSS.php:     if ( $directiveNode->name === '@charset' ) {
lib/Less/Visitor/toCSS.php:             $key = $rule->name;

The only one that seems plausible is the references in toCSS.php, but those have explicit Rule or NameValue type checks which each have a name property already.

Do you have a stack trace or reproduction case for this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<b>Deprecated</b>:  Creation of dynamic property Less_Tree_Color::$name is deprecated in <b>/usr/share/php/Icinga/Less/Visitor.php</b> on line <b>196</b><br />

See: https://github.com/Icinga/icingaweb2/blob/v2.11.3/library/Icinga/Less/Visitor.php#L196

Copy link
Member

@Krinkle Krinkle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll land this without the Color change for now.

@Krinkle Krinkle closed this in b8cad5f Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants