spaze / phpstan-disallowed-calls

PHPStan rules to detect disallowed method & function calls, constant, namespace, attribute & superglobal usages
MIT License
255 stars 17 forks source link

Use the same types in phpdoc as what the method signature says #175

Closed spaze closed 1 year ago

spaze commented 1 year ago

Resolves

 ------ --------------------------------------------------------------------------------------------------------------------------------------------
  Line   Usages/ClassConstantUsages.php
 ------ --------------------------------------------------------------------------------------------------------------------------------------------
  73     Instanceof between PhpParser\Node\Expr\ClassConstFetch and PhpParser\Node\Expr\ClassConstFetch will always evaluate to true.
         💡 Because the type is coming from a PHPDoc, you can turn off this check by setting treatPhpDocTypesAsCertain: false in your phpstan.neon.
 ------ --------------------------------------------------------------------------------------------------------------------------------------------

 ------ --------------------------------------------------------------------------------------------------------------------------------------------
  Line   Usages/VariableUsages.php
 ------ --------------------------------------------------------------------------------------------------------------------------------------------
  56     Instanceof between PhpParser\Node\Expr\Variable and PhpParser\Node\Expr\Variable will always evaluate to true.
         💡 Because the type is coming from a PHPDoc, you can turn off this check by setting treatPhpDocTypesAsCertain: false in your phpstan.neon.
 ------ --------------------------------------------------------------------------------------------------------------------------------------------
spaze commented 1 year ago

Tests failed because this was merged before #174 but that's ok.