Skip to content

Commit 1108c45

Browse files
committed
Improve compatibility with PHPStan 1.0
1 parent fb817e2 commit 1108c45

File tree

5 files changed

+25
-23
lines changed

5 files changed

+25
-23
lines changed

‎phpstan.neon

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ includes:
77
- phar://phpstan.phar/conf/bleedingEdge.neon
88

99
parameters:
10-
excludes_analyse:
10+
excludePaths:
1111
- tests/tmp/*
1212
- tests/*/Example*.php
1313
- tests/*/console_application_loader.php

‎tests/Rules/Symfony/UndefinedArgumentRuleTest.php

+7-11
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use PHPStan\Rules\Rule;
77
use PHPStan\Symfony\ConsoleApplicationResolver;
88
use PHPStan\Testing\RuleTestCase;
9-
use PHPStan\Type\Symfony\ArgumentTypeSpecifyingExtension;
109

1110
/**
1211
* @extends RuleTestCase<UndefinedArgumentRule>
@@ -19,16 +18,6 @@ protected function getRule(): Rule
1918
return new UndefinedArgumentRule(new ConsoleApplicationResolver(__DIR__ . '/console_application_loader.php'), new Standard());
2019
}
2120

22-
/**
23-
* @return \PHPStan\Type\MethodTypeSpecifyingExtension[]
24-
*/
25-
protected function getMethodTypeSpecifyingExtensions(): array
26-
{
27-
return [
28-
new ArgumentTypeSpecifyingExtension(new Standard()),
29-
];
30-
}
31-
3221
public function testGetArgument(): void
3322
{
3423
$this->analyse(
@@ -44,4 +33,11 @@ public function testGetArgument(): void
4433
);
4534
}
4635

36+
public static function getAdditionalConfigFiles(): array
37+
{
38+
return [
39+
__DIR__ . '/argument.neon',
40+
];
41+
}
42+
4743
}

‎tests/Rules/Symfony/UndefinedOptionRuleTest.php

+7-11
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use PHPStan\Rules\Rule;
77
use PHPStan\Symfony\ConsoleApplicationResolver;
88
use PHPStan\Testing\RuleTestCase;
9-
use PHPStan\Type\Symfony\OptionTypeSpecifyingExtension;
109

1110
/**
1211
* @extends RuleTestCase<UndefinedOptionRule>
@@ -19,16 +18,6 @@ protected function getRule(): Rule
1918
return new UndefinedOptionRule(new ConsoleApplicationResolver(__DIR__ . '/console_application_loader.php'), new Standard());
2019
}
2120

22-
/**
23-
* @return \PHPStan\Type\MethodTypeSpecifyingExtension[]
24-
*/
25-
protected function getMethodTypeSpecifyingExtensions(): array
26-
{
27-
return [
28-
new OptionTypeSpecifyingExtension(new Standard()),
29-
];
30-
}
31-
3221
public function testGetArgument(): void
3322
{
3423
$this->analyse(
@@ -44,4 +33,11 @@ public function testGetArgument(): void
4433
);
4534
}
4635

36+
public static function getAdditionalConfigFiles(): array
37+
{
38+
return [
39+
__DIR__ . '/option.neon',
40+
];
41+
}
42+
4743
}

‎tests/Rules/Symfony/argument.neon

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
services:
2+
-
3+
class: PHPStan\Type\Symfony\ArgumentTypeSpecifyingExtension
4+
tags:
5+
- phpstan.typeSpecifier.methodTypeSpecifyingExtension

‎tests/Rules/Symfony/option.neon

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
services:
2+
-
3+
class: PHPStan\Type\Symfony\OptionTypeSpecifyingExtension
4+
tags:
5+
- phpstan.typeSpecifier.methodTypeSpecifyingExtension

0 commit comments

Comments
 (0)