diff --git a/extension.neon b/extension.neon index a1a0002..d3f6ea3 100644 --- a/extension.neon +++ b/extension.neon @@ -1,4 +1,6 @@ services: + - + class: SzepeViktor\PHPStan\WordPress\HookDocBlock - class: SzepeViktor\PHPStan\WordPress\WpThemeGetDynamicMethodReturnTypeExtension tags: diff --git a/src/ApplyFiltersDynamicFunctionReturnTypeExtension.php b/src/ApplyFiltersDynamicFunctionReturnTypeExtension.php index 55cfa09..ce618b5 100644 --- a/src/ApplyFiltersDynamicFunctionReturnTypeExtension.php +++ b/src/ApplyFiltersDynamicFunctionReturnTypeExtension.php @@ -11,7 +11,6 @@ use PhpParser\Node\Expr\FuncCall; use PHPStan\Analyser\Scope; use PHPStan\Reflection\FunctionReflection; -use PHPStan\Type\FileTypeMapper; use PHPStan\Type\MixedType; use PHPStan\Type\Type; @@ -20,9 +19,9 @@ class ApplyFiltersDynamicFunctionReturnTypeExtension implements \PHPStan\Type\Dy /** @var \SzepeViktor\PHPStan\WordPress\HookDocBlock */ protected $hookDocBlock; - public function __construct(FileTypeMapper $fileTypeMapper) + public function __construct(HookDocBlock $hookDocBlock) { - $this->hookDocBlock = new HookDocBlock($fileTypeMapper); + $this->hookDocBlock = $hookDocBlock; } public function isFunctionSupported(FunctionReflection $functionReflection): bool