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

Simplify check for property hooks support #6044

Open
sebastianbergmann opened this issue Nov 25, 2024 · 5 comments
Open

Simplify check for property hooks support #6044

sebastianbergmann opened this issue Nov 25, 2024 · 5 comments
Assignees
Labels
feature/test-doubles Test Stubs and Mock Objects type/refactoring A refactoring that should be applied to make the code easier to understand and maintain

Comments

@sebastianbergmann
Copy link
Owner

Reapply 8da3b58 (revert bcfa1c9) when PHPStan knows about new Reflection API methods introduced in PHP 8.4.

@sebastianbergmann sebastianbergmann added type/refactoring A refactoring that should be applied to make the code easier to understand and maintain feature/test-doubles Test Stubs and Mock Objects labels Nov 25, 2024
@sebastianbergmann sebastianbergmann self-assigned this Nov 25, 2024
@staabm
Copy link
Contributor

staabm commented Nov 27, 2024

this might have been fixed today with phpstan/phpstan-src@5ec4762 (not yet released)

@staabm
Copy link
Contributor

staabm commented Dec 1, 2024

released in PHPStan 2.0.3

@sebastianbergmann
Copy link
Owner Author

PHPStan 2.0.3 does not seem to solve the issue for me:

❯ git revert bcfa1c92c7e049676679f831332ed87d94cc969f
Auto-merging src/Framework/MockObject/Generator/Generator.php
[11.5 d0f633ed77] Reapply "Simplify after PHP 8.4.1 release"
 1 file changed, 3 insertions(+), 9 deletions(-)
❯ ./tools/phpstan
Note: Using configuration file /usr/local/src/phpunit/phpstan.neon.
 910/910 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%

 ------ --------------------------------------------------------------------- 
  Line   Framework/MockObject/Generator/Generator.php                         
 ------ --------------------------------------------------------------------- 
  1241   Call to an undefined method ReflectionProperty::isFinal().           
         🪪  method.notFound                                                  
  1245   Call to an undefined method ReflectionProperty::hasHooks().          
         🪪  method.notFound                                                  
  1252   Access to constant Get on an unknown class PropertyHookType.         
         🪪  class.notFound                                                   
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols  
  1252   Call to an undefined method ReflectionProperty::hasHook().           
         🪪  method.notFound                                                  
  1253   Access to constant Get on an unknown class PropertyHookType.         
         🪪  class.notFound                                                   
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols  
  1253   Call to an undefined method ReflectionProperty::getHook().           
         🪪  method.notFound                                                  
  1257   Access to constant Set on an unknown class PropertyHookType.         
         🪪  class.notFound                                                   
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols  
  1257   Call to an undefined method ReflectionProperty::hasHook().           
         🪪  method.notFound                                                  
  1258   Access to constant Set on an unknown class PropertyHookType.         
         🪪  class.notFound                                                   
         💡 Learn more at https://phpstan.org/user-guide/discovering-symbols  
  1258   Call to an undefined method ReflectionProperty::getHook().           
         🪪  method.notFound                                                  
 ------ --------------------------------------------------------------------- 

 [ERROR] Found 10 errors                                                                                                

@staabm
Copy link
Contributor

staabm commented Dec 1, 2024

thanks for the repro, I will keep you posted when it works.

@staabm
Copy link
Contributor

staabm commented Dec 1, 2024

will track at phpstan end on phpstan/phpstan#12162

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/test-doubles Test Stubs and Mock Objects type/refactoring A refactoring that should be applied to make the code easier to understand and maintain
Projects
None yet
Development

No branches or pull requests

2 participants