Skip to content

Commit

Permalink
Add constructor :closes: #7119
Browse files Browse the repository at this point in the history
  • Loading branch information
Khadreal committed Nov 22, 2024
1 parent b306f65 commit a7bfc41
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
16 changes: 16 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
parameters:
ignoreErrors:
-
message: "#^One or more @param tags has an invalid name or invalid syntax\\.$#"
count: 1
path: inc/Engine/Common/PerformanceHints/Frontend/Subscriber.php

-
message: "#^Access to an undefined property PhpParser\\\\Node\\:\\:\\$name\\.$#"
count: 1
path: tests/phpstan/Rules/ApplyFiltersTypedDynamicFunctionReturnTypeExtension.php

-
message: "#^Property WP_Rocket\\\\Tests\\\\phpstan\\\\Rules\\\\ApplyFiltersTypedDynamicFunctionReturnTypeExtension\\:\\:\\$currentNode \\(PhpParser\\\\Node\\\\Expr\\\\FuncCall\\) does not accept PhpParser\\\\Node\\.$#"
count: 1
path: tests/phpstan/Rules/ApplyFiltersTypedDynamicFunctionReturnTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use PHPStan\Rules\Rule;
use PHPStan\Rules\RuleErrorBuilder;
use PHPStan\Rules\RuleLevelHelper;
use PHPStan\Type\FileTypeMapper;
use PHPStan\Type\VerbosityLevel;
use SzepeViktor\PHPStan\WordPress\HookDocBlock;
use PHPStan\PhpDoc\Tag\ParamTag;
Expand All @@ -38,6 +39,14 @@ class ApplyFiltersTypedDynamicFunctionReturnTypeExtension implements Rule
/** @var list<IdentifierRuleError> */
private $errors;

public function __construct(
FileTypeMapper $fileTypeMapper,
RuleLevelHelper $ruleLevelHelper
) {
$this->hookDocBlock = new HookDocBlock($fileTypeMapper);
$this->ruleLevelHelper = $ruleLevelHelper;
}

public function getNodeType(): string
{
return FuncCall::class;
Expand Down

0 comments on commit a7bfc41

Please sign in to comment.