phpunit icon indicating copy to clipboard operation
phpunit copied to clipboard

Simplify check for property hooks support

Open sebastianbergmann opened this issue 1 year ago • 6 comments

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

sebastianbergmann avatar Nov 25 '24 11:11 sebastianbergmann

this might have been fixed today with https://github.com/phpstan/phpstan-src/commit/5ec47623fa31f63912d904ba90693eac64b0de0c (not yet released)

staabm avatar Nov 27 '24 09:11 staabm

released in PHPStan 2.0.3

staabm avatar Dec 01 '24 08:12 staabm

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                                                                                                

sebastianbergmann avatar Dec 01 '24 08:12 sebastianbergmann

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

staabm avatar Dec 01 '24 08:12 staabm

will track at phpstan end on https://github.com/phpstan/phpstan/issues/12162

staabm avatar Dec 01 '24 08:12 staabm