propelorm / Propel2

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

Fix PHPStan #1938

Closed dereuromark closed 1 year ago

dereuromark commented 1 year ago

PHPStan latest version seems to make master red

This fixes the issues for <=8.1

For 8.2 we first need to add the version into CI matrix and then fix the following:

 ------ -------------------------------------------------------------------------------------------------------------------------- 
  Line   Propel/Generator/Behavior/Archivable/ArchivableBehavior.php                                                               
 ------ -------------------------------------------------------------------------------------------------------------------------- 
  69     Call to function property_exists() with Propel\Generator\Model\Table and 'isArchiveTable' will always evaluate to false.  
 ------ -------------------------------------------------------------------------------------------------------------------------- 

 ------ -------------------------------------------------------------------------------------------------------------------------------------------------------- 
  Line   Propel/Generator/Behavior/ConcreteInheritance/ConcreteInheritanceBehavior.php                                                                           
 ------ -------------------------------------------------------------------------------------------------------------------------------------------------------- 
  90     Ignored error pattern #^Access to an undefined property Propel\\Generator\\Model\\ForeignKey\:\:\$isParentChild\.$# in path                             
         /work/git/Propel2/src/Propel/Generator/Behavior/ConcreteInheritance/ConcreteInheritanceBehavior.php is expected to occur 1 time, but occurred 2 times.  
  389    Access to an undefined property Propel\Generator\Model\ForeignKey::$isParentChild.                                                                      
 ------ -------------------------------------------------------------------------------------------------------------------------------------------------------- 

 ------ -------------------------------------------------------------------------------------------------------------------------- 
  Line   Propel/Generator/Behavior/Versionable/VersionableBehavior.php                                                             
 ------ -------------------------------------------------------------------------------------------------------------------------- 
  70     Call to function property_exists() with Propel\Generator\Model\Table and 'isVersionTable' will always evaluate to false.  
 ------ -------------------------------------------------------------------------------------------------------------------------- 

 [ERROR] Found 4 errors                                                                                                                                                                                                                      
codecov-commenter commented 1 year ago

Codecov Report

Base: 88.29% // Head: 88.29% // Decreases project coverage by -0.00% :warning:

Coverage data is based on head (23232e0) compared to base (e220b28). Patch coverage: 80.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1938 +/- ## ============================================ - Coverage 88.29% 88.29% -0.01% - Complexity 7951 7952 +1 ============================================ Files 242 242 Lines 24209 24211 +2 ============================================ + Hits 21375 21376 +1 - Misses 2834 2835 +1 ``` | Flag | Coverage Δ | | |---|---|---| | 5-max | `88.29% <80.00%> (-0.01%)` | :arrow_down: | | 7.4 | `88.29% <80.00%> (-0.01%)` | :arrow_down: | | agnostic | `67.60% <60.00%> (-0.01%)` | :arrow_down: | | mysql | `68.99% <80.00%> (-0.01%)` | :arrow_down: | | pgsql | `68.99% <80.00%> (-0.01%)` | :arrow_down: | | sqlite | `66.95% <80.00%> (-0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://codecov.io/gh/propelorm/Propel2/pull/1938?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm) | Coverage Δ | | |---|---|---| | [src/Propel/Common/Config/Loader/FileLoader.php](https://codecov.io/gh/propelorm/Propel2/pull/1938/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm#diff-c3JjL1Byb3BlbC9Db21tb24vQ29uZmlnL0xvYWRlci9GaWxlTG9hZGVyLnBocA==) | `97.89% <ø> (ø)` | | | [src/Propel/Runtime/Util/PropelDateTime.php](https://codecov.io/gh/propelorm/Propel2/pull/1938/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm#diff-c3JjL1Byb3BlbC9SdW50aW1lL1V0aWwvUHJvcGVsRGF0ZVRpbWUucGhw) | `95.45% <66.66%> (-2.17%)` | :arrow_down: | | [src/Propel/Runtime/Util/UuidConverter.php](https://codecov.io/gh/propelorm/Propel2/pull/1938/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm#diff-c3JjL1Byb3BlbC9SdW50aW1lL1V0aWwvVXVpZENvbnZlcnRlci5waHA=) | `77.77% <100.00%> (ø)` | | | [.../Runtime/Validator/Constraints/UniqueValidator.php](https://codecov.io/gh/propelorm/Propel2/pull/1938/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm#diff-c3JjL1Byb3BlbC9SdW50aW1lL1ZhbGlkYXRvci9Db25zdHJhaW50cy9VbmlxdWVWYWxpZGF0b3IucGhw) | `92.85% <100.00%> (ø)` | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.