Skip to content

Commit e844c05

Browse files
committed
Mark \Drupal::VERSION as a dynamic constant
1 parent 57b5b16 commit e844c05

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

extension.neon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ parameters:
1111
- install
1212
- profile
1313
- engine
14+
dynamicConstantNames:
15+
- Drupal::VERSION
1416
scanFiles:
1517
- stubs/Twig/functions.stub
1618
stubFiles:

phpstan.neon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ parameters:
1010
- tests/src
1111
excludePaths:
1212
- tests/src/Type/data/*.php
13+
dynamicConstantNames:
14+
- Drupal::VERSION

tests/src/Rules/GetDeprecatedServiceRuleTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ protected function getRule(): \PHPStan\Rules\Rule
2020
*/
2121
public function testRuleDrupal8(string $path, array $errorMessages): void
2222
{
23-
// @phpstan-ignore-next-line
2423
if (version_compare('9.0.0', \Drupal::VERSION) !== 1) {
2524
self::markTestSkipped('Only tested on Drupal 8.x.x');
2625
}
@@ -34,7 +33,6 @@ public function testRuleDrupal8(string $path, array $errorMessages): void
3433
public function testRuleDrupal9(string $path, array $errorMessages): void
3534
{
3635
[$version] = explode('.', \Drupal::VERSION, 2);
37-
// @phpstan-ignore-next-line
3836
if ($version !== '9') {
3937
self::markTestSkipped('Only tested on Drupal 9.x.x');
4038
}

0 commit comments

Comments
 (0)