Skip to content

Commit

Permalink
Removed always true PHP_VERSION_ID condition
Browse files Browse the repository at this point in the history
  • Loading branch information
staabm authored and ondrejmirtes committed Oct 26, 2024
1 parent f4a969d commit 81833b5
Showing 1 changed file with 24 additions and 28 deletions.
52 changes: 24 additions & 28 deletions tests/Rules/Deprecations/FetchingDeprecatedConstRuleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use PHPStan\Rules\Rule;
use PHPStan\Testing\RuleTestCase;
use function defined;
use const PHP_VERSION_ID;

/**
* @extends RuleTestCase<FetchingDeprecatedConstRule>
Expand All @@ -28,33 +27,30 @@ public function testFetchingDeprecatedConst(): void
}

$expectedErrors = [];

if (PHP_VERSION_ID >= 70300) {
$expectedErrors[] = [
'Use of constant FILTER_FLAG_SCHEME_REQUIRED is deprecated.',
5,
];
$expectedErrors[] = [
'Use of constant FILTER_FLAG_HOST_REQUIRED is deprecated.',
6,
];
$expectedErrors[] = [
'Use of constant FILTER_FLAG_SCHEME_REQUIRED is deprecated.',
7,
];
$expectedErrors[] = [
'Use of constant FILTER_FLAG_HOST_REQUIRED is deprecated.',
8,
];
$expectedErrors[] = [
'Use of constant FILTER_FLAG_SCHEME_REQUIRED is deprecated.',
37,
];
$expectedErrors[] = [
'Use of constant FILTER_FLAG_HOST_REQUIRED is deprecated.',
38,
];
}
$expectedErrors[] = [
'Use of constant FILTER_FLAG_SCHEME_REQUIRED is deprecated.',
5,
];
$expectedErrors[] = [
'Use of constant FILTER_FLAG_HOST_REQUIRED is deprecated.',
6,
];
$expectedErrors[] = [
'Use of constant FILTER_FLAG_SCHEME_REQUIRED is deprecated.',
7,
];
$expectedErrors[] = [
'Use of constant FILTER_FLAG_HOST_REQUIRED is deprecated.',
8,
];
$expectedErrors[] = [
'Use of constant FILTER_FLAG_SCHEME_REQUIRED is deprecated.',
37,
];
$expectedErrors[] = [
'Use of constant FILTER_FLAG_HOST_REQUIRED is deprecated.',
38,
];

require_once __DIR__ . '/data/fetching-deprecated-const-definition.php';
$this->analyse(
Expand Down

0 comments on commit 81833b5

Please sign in to comment.