Skip to content

Conversation

andypost
Copy link
Contributor

@ondrejmirtes
Copy link
Member

Needs a regression test in ClassAttributesRuleTest.

@andypost
Copy link
Contributor Author

Thank you, will do today

@andypost andypost force-pushed the allow-dynamic-properties branch from fc1f8a2 to 6a5ef7f Compare June 30, 2022 22:31
@andypost
Copy link
Contributor Author

Added test but can't make it work on PHP 8.2 but on earlier PHP versions it throws 05: Attribute class AllowDynamicProperties does not exist. when I comment out attribute definition. That's exactly what the bug is

@andypost andypost force-pushed the allow-dynamic-properties branch from 6a5ef7f to e78744b Compare June 30, 2022 22:35
@ondrejmirtes ondrejmirtes changed the base branch from 1.7.x to 1.8.x July 1, 2022 11:55
@ondrejmirtes
Copy link
Member

Merged as: d122cf4

It works fine in my opinion.

@andypost andypost deleted the allow-dynamic-properties branch July 1, 2022 12:00
@andypost
Copy link
Contributor Author

andypost commented Jul 1, 2022

Thank you!

@mglaman
Copy link
Contributor

mglaman commented Jul 1, 2022

Thanks, as always, @ondrejmirtes !

@andypost
Copy link
Contributor Author

@ondrejmirtes somehow now it fails on PHP 8.2 alpha3 but https://3v4l.org/hIKTZ/rfc#vgit.master reports that class exists

Class AllowDynamicProperties is not an Attribute class. maybe it needs some definition somewhere?

@andypost
Copy link
Contributor Author

It needs to update phpstorm-stubs after PR JetBrains/phpstorm-stubs#1404

@ondrejmirtes
Copy link
Member

@andypost Please test 1.8.x-dev with composer require --dev phpstan/phpstan:1.8.x-dev to see if it fixes your problem.

@andypost
Copy link
Contributor Author

@ondrejmirtes thank you! it works! waiting for new release (and this week 8.2 beta1 coming)

/var/www/html/web $ vendor/bin/phpstan analyze -l 2 --debug core/modules/views/src/ResultRow.php
/var/www/html/web/core/modules/views/src/ResultRow.php

                                                                                                                        
 [OK] No errors                                                                                                         
                                                                                                                        

/var/www/html/web $ php -v
PHP 8.2.0alpha3 (cli) (built: Jul  9 2022 13:42:07) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.0-dev, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.0alpha3, Copyright (c), by Zend Technologies

/var/www/html/web $ vendor/bin/phpstan -V
PHPStan - PHP Static Analysis Tool 1.8.x-dev@d866a66

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

Successfully merging this pull request may close these issues.

3 participants