| 1 | <?php |
||
| 11 | class FinalStaticUsage implements AnalyzerPassInterface |
||
| 12 | { |
||
| 13 | use DefaultMetadataPassTrait { |
||
| 14 | DefaultMetadataPassTrait::getMetadata as defaultMetadata; |
||
| 15 | } |
||
| 16 | |||
| 17 | const DESCRIPTION = 'Checks for use of `static::` inside a final class.'; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @param Expr\StaticCall $expr |
||
| 21 | * @param Context $context |
||
| 22 | * @return bool |
||
| 23 | */ |
||
| 24 | 1 | public function pass(Expr\StaticCall $expr, Context $context) |
|
| 43 | |||
| 44 | /** |
||
| 45 | * @return array |
||
| 46 | */ |
||
| 47 | 1 | public function getRegister() |
|
| 53 | |||
| 54 | /** |
||
| 55 | * {@inheritdoc} |
||
| 56 | */ |
||
| 57 | 1 | public static function getMetadata() |
|
| 64 | } |
||
| 65 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: