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

Add AllowDynamicProperties stub #1478

Closed
wants to merge 1 commit into from

Conversation

@ondrejmirtes
Copy link
Member

Needs a regression test in ClassAttributesRuleTest.

@andypost
Copy link
Contributor Author

Thank you, will do today

@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

@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
3 participants