Skip to content

Commit df9c68f

Browse files
authored
Remove dead PHP_VERSION_ID check (#712)
1 parent 24b567f commit df9c68f

12 files changed

+15
-61
lines changed

tests/default/DbaInferenceTest.php

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,17 @@ class DbaInferenceTest extends TypeInferenceTestCase
1313
{
1414
public function dataFileAsserts(): iterable
1515
{
16-
if (\PHP_VERSION_ID >= 70300) {
17-
if (! InstalledVersions::isInstalled('doctrine/dbal')) {
18-
throw new \Exception('doctrine/dbal 3.x is required to run tests for php 7.3+. Please install it via composer.');
19-
}
20-
21-
yield from $this->gatherAssertTypes(__DIR__ . '/data/doctrine-dbal-union-result.php');
22-
yield from $this->gatherAssertTypes(__DIR__ . '/data/doctrine-dbal.php');
23-
yield from $this->gatherAssertTypes(__DIR__ . '/data/inference-placeholder.php');
24-
25-
// for some reason does not work in pgsql
26-
if ('pdo-pgsql' !== getenv('DBA_REFLECTOR')) {
27-
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-680.php');
28-
}
16+
if (! InstalledVersions::isInstalled('doctrine/dbal')) {
17+
throw new \Exception('doctrine/dbal 3.x is required to run tests for php 7.3+. Please install it via composer.');
18+
}
19+
20+
yield from $this->gatherAssertTypes(__DIR__ . '/data/doctrine-dbal-union-result.php');
21+
yield from $this->gatherAssertTypes(__DIR__ . '/data/doctrine-dbal.php');
22+
yield from $this->gatherAssertTypes(__DIR__ . '/data/inference-placeholder.php');
23+
24+
// for some reason does not work in pgsql
25+
if ('pdo-pgsql' !== getenv('DBA_REFLECTOR')) {
26+
yield from $this->gatherAssertTypes(__DIR__ . '/data/bug-680.php');
2927
}
3028

3129
// make sure class constants can be resolved

tests/rules/QueryPlanAnalyzerRuleTest.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ public function testNotUsingIndex(): void
6262
self::markTestSkipped('query plan analyzer requires a active database connection');
6363
}
6464

65-
if (\PHP_VERSION_ID < 70300) {
66-
self::markTestSkipped('not yet supported on php < 7.3');
67-
}
68-
6965
$this->numberOfAllowedUnindexedReads = true;
7066
$this->numberOfRowsNotRequiringIndex = 2;
7167

@@ -111,10 +107,6 @@ public function testNotUsingIndexInDebugMode(): void
111107
self::markTestSkipped('query plan analyzer requires a active database connection');
112108
}
113109

114-
if (\PHP_VERSION_ID < 70300) {
115-
self::markTestSkipped('not yet supported on php < 7.3');
116-
}
117-
118110
$this->debugMode = true;
119111
$this->numberOfAllowedUnindexedReads = true;
120112
$this->numberOfRowsNotRequiringIndex = 2;

tests/rules/SyntaxErrorInDibiPreparedStatementMethodRuleTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ public static function getAdditionalConfigFiles(): array
3030

3131
public function testSyntaxErrorInQueryRule(): void
3232
{
33-
if (\PHP_VERSION_ID < 70400) {
34-
self::markTestSkipped('Test requires PHP 7.4.');
35-
}
36-
3733
if (MysqliQueryReflector::NAME === getenv('DBA_REFLECTOR')) {
3834
$expectedErrors = [
3935
[

tests/rules/SyntaxErrorInPreparedStatementMethodRuleTest.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ public static function getAdditionalConfigFiles(): array
3030

3131
public function testSyntaxErrorInQueryRule(): void
3232
{
33-
if (\PHP_VERSION_ID < 70400) {
34-
self::markTestSkipped('Test requires PHP 7.4.');
35-
}
36-
3733
if (MysqliQueryReflector::NAME === getenv('DBA_REFLECTOR')) {
3834
$expectedErrors = [
3935
[
@@ -232,10 +228,6 @@ public function testSyntaxErrorInQueryRule(): void
232228

233229
public function testBug94()
234230
{
235-
if (\PHP_VERSION_ID < 70400) {
236-
self::markTestSkipped('Test requires PHP 7.4.');
237-
}
238-
239231
if (MysqliQueryReflector::NAME === getenv('DBA_REFLECTOR')) {
240232
self::markTestSkipped('Error message different depending on version of the database.');
241233
} elseif (PdoPgSqlQueryReflector::NAME === getenv('DBA_REFLECTOR')) {
@@ -263,10 +255,6 @@ public function testBug94()
263255

264256
public function testSyntaxErrorWithInferencePlaceholder()
265257
{
266-
if (\PHP_VERSION_ID < 70400) {
267-
self::markTestSkipped('Test requires PHP 7.4.');
268-
}
269-
270258
if (MysqliQueryReflector::NAME === getenv('DBA_REFLECTOR')) {
271259
$expectedErrors = [
272260
[

tests/rules/SyntaxErrorInPreparedStatementMethodSubclassedRuleTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ public static function getAdditionalConfigFiles(): array
3030

3131
public function testSyntaxErrorInQueryRule(): void
3232
{
33-
if (\PHP_VERSION_ID < 70400) {
34-
self::markTestSkipped('Test requires PHP 7.4.');
35-
}
36-
3733
$this->analyse([__DIR__ . '/data/syntax-error-in-method-subclassed.php'], $this->getExpectedErrors());
3834
}
3935

tests/rules/SyntaxErrorInQueryFunctionRuleTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ public static function getAdditionalConfigFiles(): array
3030

3131
public function testSyntaxErrorInQueryRule(): void
3232
{
33-
if (\PHP_VERSION_ID < 70400) {
34-
self::markTestSkipped('Test requires PHP 7.4.');
35-
}
36-
3733
$this->analyse([__DIR__ . '/data/syntax-error-in-query-function.php'], $this->getExpectedErrors());
3834
}
3935

tests/rules/SyntaxErrorInQueryMethodRuleTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ public static function getAdditionalConfigFiles(): array
3030

3131
public function testSyntaxErrorInQueryRule(): void
3232
{
33-
if (\PHP_VERSION_ID < 70400) {
34-
self::markTestSkipped('Test requires PHP 7.4.');
35-
}
36-
3733
if (MysqliQueryReflector::NAME === getenv('DBA_REFLECTOR')) {
3834
$expected = [
3935
[

tests/rules/SyntaxErrorInQueryMethodSubclassedRuleTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,6 @@ public static function getAdditionalConfigFiles(): array
3030

3131
public function testSyntaxErrorInQueryRule(): void
3232
{
33-
if (\PHP_VERSION_ID < 70400) {
34-
self::markTestSkipped('Test requires PHP 7.4.');
35-
}
36-
3733
$this->analyse([__DIR__ . '/data/syntax-error-in-method-subclassed.php'], $this->getExpectedErrors());
3834
}
3935

tests/sqlAst/SqlAstInferenceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class SqlAstInferenceTest extends TypeInferenceTestCase
1111
{
1212
public function dataFileAsserts(): iterable
1313
{
14-
if (\PHP_VERSION_ID >= 70400 && 'pdo-pgsql' !== getenv('DBA_REFLECTOR')) {
14+
if ('pdo-pgsql' !== getenv('DBA_REFLECTOR')) {
1515
yield from $this->gatherAssertTypes(__DIR__ . '/data/sql-ast-narrowing.php');
1616
}
1717
}

tests/sqlAst/config/bootstrap.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@
1717
$config = RuntimeConfiguration::create();
1818
$config->errorMode(RuntimeConfiguration::ERROR_MODE_EXCEPTION);
1919
$config->analyzeWriteQueries(true);
20-
if (\PHP_VERSION_ID >= 70400) {
21-
$config->utilizeSqlAst(true);
22-
}
20+
$config->utilizeSqlAst(true);
2321

2422
// $config->debugMode(true);
2523
$reflector = ReflectorFactory::create(__DIR__);

0 commit comments

Comments
 (0)