phpstan-deprecation-rules icon indicating copy to clipboard operation
phpstan-deprecation-rules copied to clipboard

Wrong deprecation error from when parent::deprecatedMethod() called from trait

Open mvorisek opened this issue 2 years ago • 0 comments

code https://github.com/atk4/data/blob/bb1c18f5dc583fca7dd372f98a0172fe66663057/src/Persistence/Sql/Postgresql/PlatformTrait.php#L115

ci https://github.com/atk4/data/runs/4342242942?check_suite_focus=true#step:11:16

 ------ ---------------------------------------------------------------------------------- 
  Line   src/Persistence/Sql/Postgresql/PlatformTrait.php (in context of anonymous class)  
 ------ ---------------------------------------------------------------------------------- 
  115    Call to method getCreateTableSQL() of deprecated class                            
         Doctrine\DBAL\Platforms\AbstractPlatform:                                         
         Use {@link PostgreSQLPlatform} instead.                                           
 ------ ---------------------------------------------------------------------------------- 

trait is implemented in anonymous class https://github.com/atk4/data/blob/bb1c18f5dc583fca7dd372f98a0172fe66663057/src/Persistence/Sql/Connection.php#L279

thus parent::getCreateTableSQL(... call inside the trait refers to (by the phpstan error recommended) PostgreSQLPlatform class

mvorisek avatar Nov 27 '21 18:11 mvorisek