Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm committed Mar 8, 2024
1 parent e9ea332 commit 9901344
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions src/Rules/Deprecations/FetchingDeprecatedConstRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use PHPStan\Rules\Rule;
use PHPStan\Rules\RuleErrorBuilder;
use function sprintf;
use const PHP_VERSION_ID;

/**
* @implements Rule<ConstFetch>
Expand All @@ -23,19 +22,10 @@ class FetchingDeprecatedConstRule implements Rule
/** @var DeprecatedScopeHelper */
private $deprecatedScopeHelper;

/** @var array<string,string> */
private $deprecatedConstants = [];

public function __construct(ReflectionProvider $reflectionProvider, DeprecatedScopeHelper $deprecatedScopeHelper)
{
$this->reflectionProvider = $reflectionProvider;
$this->deprecatedScopeHelper = $deprecatedScopeHelper;

// phpcs:ignore SlevomatCodingStandard.ControlStructures.EarlyExit.EarlyExitNotUsed
if (PHP_VERSION_ID >= 70300) {
$this->deprecatedConstants['FILTER_FLAG_SCHEME_REQUIRED'] = 'Use of constant %s is deprecated since PHP 7.3.';
$this->deprecatedConstants['FILTER_FLAG_HOST_REQUIRED'] = 'Use of constant %s is deprecated since PHP 7.3.';
}
}

public function getNodeType(): string
Expand Down Expand Up @@ -64,15 +54,6 @@ public function processNode(Node $node, Scope $scope): array
];
}

if (isset($this->deprecatedConstants[$constantReflection->getName()])) {
return [
RuleErrorBuilder::message(sprintf(
$this->deprecatedConstants[$constantReflection->getName()],
$constantReflection->getName()
))->identifier('constant.deprecated')->build(),
];
}

return [];
}

Expand Down

0 comments on commit 9901344

Please sign in to comment.