propelorm / Propel2

Propel2 is an open-source high-performance Object-Relational Mapping (ORM) for modern PHP
http://propelorm.org/
MIT License
1.26k stars 399 forks source link

fix stan #1721

Closed mringler closed 3 years ago

mringler commented 3 years ago

Not sure why, but phpstan fails during #1719 and #1720:

 Error: ] Found 5 errors                                                         

Error: Ignored error pattern #^Call to an undefined static method Propel\\Runtime\\ActiveQuery\\BaseModelCriteria\:\:getShortName\(\)\.$# in path /home/runner/work/Propel2/Propel2/src/Propel/Runtime/ActiveQuery/BaseModelCriteria.php was not matched in reported errors.
Error: Call to an undefined static method static(Propel\Runtime\ActiveQuery\BaseModelCriteria)::getShortName().
Error: Ignored error pattern #^Strict comparison using \!\=\= between null and null will always evaluate to false\.$# in path /home/runner/work/Propel2/Propel2/src/Propel/Runtime/ActiveQuery/Criteria.php was not matched in reported errors.
Error: Ignored error pattern #^Variable \$sql might not be defined\.$# in path /home/runner/work/Propel2/Propel2/src/Propel/Runtime/ActiveQuery/Criteria.php was not matched in reported errors.
Error: Ignored error pattern #^Variable \$sql might not be defined\.$# in path /home/runner/work/Propel2/Propel2/src/Propel/Runtime/ActiveQuery/ModelCriteria.php was not matched in reported errors.
Script vendor/bin/phpstan analyze handling the stan event returned with error code 1
Error: Process completed with exit code 1.

This PR fixes the offending errors (one access of a static child method in parent through static and several times access of a variable declared in a try in the catch block). So with the offending lines and the rules to ignore them gone, the errors might be gone, too. The actual problem is something else though, since smelly code + ignore warning should have worked, too. Any idea why this suddenly broke?