Skip to content

Commit

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

/**
* @implements Rule<ConstFetch>
Expand All @@ -22,19 +21,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 All @@ -61,13 +51,6 @@ public function processNode(Node $node, Scope $scope): array
)];
}

if (isset($this->deprecatedConstants[$constantReflection->getName()])) {
return [sprintf(
$this->deprecatedConstants[$constantReflection->getName()],
$constantReflection->getName()
)];
}

return [];
}

Expand Down

0 comments on commit 437ac71

Please sign in to comment.