Skip to content

Commit a335b36

Browse files
committed
opposite route
1 parent 9c0134d commit a335b36

File tree

5 files changed

+18
-35
lines changed

5 files changed

+18
-35
lines changed

src/DependencyInjection/ContainerFactory.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
use PHPStan\Reflection\ReflectionProvider;
3131
use PHPStan\Reflection\ReflectionProviderStaticAccessor;
3232
use PHPStan\ShouldNotHappenException;
33-
use PHPStan\Type\Constant\ConstantArrayTypeBuilder;
3433
use PHPStan\Type\ObjectType;
3534
use function array_diff_key;
3635
use function array_intersect;
@@ -200,7 +199,6 @@ public static function postInitializeContainer(Container $container): void
200199
$container->getService('typeSpecifier');
201200

202201
BleedingEdgeToggle::setBleedingEdge($container->getParameter('featureToggles')['bleedingEdge']);
203-
ConstantArrayTypeBuilder::setArrayCountLimit(256);
204202
}
205203

206204
public function getCurrentWorkingDirectory(): string

tests/PHPStan/Analyser/AnalyserIntegrationTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -682,11 +682,8 @@ public function testBug1447(): void
682682
$this->assertNoErrors($errors);
683683
}
684684

685-
/** @runInSeparateProcess */
686685
public function testBug5081(): void
687686
{
688-
ConstantArrayTypeBuilder::setArrayCountLimit(ConstantArrayTypeBuilder::ARRAY_COUNT_LIMIT);
689-
690687
$errors = $this->runAnalyse(__DIR__ . '/data/bug-5081.php');
691688
$this->assertNoErrors($errors);
692689
}
@@ -1205,8 +1202,11 @@ public static function getAdditionalConfigFiles(): array
12051202
];
12061203
}
12071204

1205+
/** @runInSeparateProcess */
12081206
public function testBug8004(): void
12091207
{
1208+
ConstantArrayTypeBuilder::setArrayCountLimit(256);
1209+
12101210
$errors = $this->runAnalyse(__DIR__ . '/data/bug-8004.php');
12111211
$this->assertCount(2, $errors);
12121212
$this->assertSame('Strict comparison using !== between null and DateTimeInterface|string will always evaluate to true.', $errors[0]->getMessage());

tests/PHPStan/Analyser/NodeScopeResolverTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use EnumTypeAssertions\Foo;
66
use PHPStan\File\FileHelper;
77
use PHPStan\Testing\TypeInferenceTestCase;
8+
use PHPStan\Type\Constant\ConstantArrayTypeBuilder;
89
use PHPUnit\Framework\Attributes\DataProvider;
910
use stdClass;
1011
use function array_merge;
@@ -19,6 +20,9 @@
1920
use const PHP_INT_SIZE;
2021
use const PHP_VERSION_ID;
2122

23+
/**
24+
* @runInSeparateProcess
25+
*/
2226
class NodeScopeResolverTest extends TypeInferenceTestCase
2327
{
2428

@@ -273,6 +277,8 @@ public static function dataFile(): iterable
273277
#[DataProvider('dataFile')]
274278
public function testFile(string $file): void
275279
{
280+
ConstantArrayTypeBuilder::setArrayCountLimit(256);
281+
276282
$asserts = self::gatherAssertTypes($file);
277283
$this->assertNotCount(0, $asserts, sprintf('File %s has no asserts.', $file));
278284
$failures = [];

tests/PHPStan/Rules/Methods/ReturnTypeRuleBug8636Test.php

Lines changed: 0 additions & 30 deletions
This file was deleted.

tests/PHPStan/Rules/Methods/ReturnTypeRuleTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use PHPStan\Rules\Rule;
77
use PHPStan\Rules\RuleLevelHelper;
88
use PHPStan\Testing\RuleTestCase;
9+
use PHPStan\Type\Constant\ConstantArrayTypeBuilder;
910
use PHPUnit\Framework\Attributes\DataProvider;
1011
use PHPUnit\Framework\Attributes\RequiresPhp;
1112
use const PHP_VERSION_ID;
@@ -855,8 +856,11 @@ public function testBug8223(): void
855856
$this->analyse([__DIR__ . '/data/bug-8223.php'], $errors);
856857
}
857858

859+
/** @runInSeparateProcess */
858860
public function testBug8146bErrors(): void
859861
{
862+
ConstantArrayTypeBuilder::setArrayCountLimit(256);
863+
860864
$this->checkBenevolentUnionTypes = true;
861865
$this->analyse([__DIR__ . '/data/bug-8146b-errors.php'], [
862866
[
@@ -1291,4 +1295,9 @@ public function testBug10771(): void
12911295
$this->analyse([__DIR__ . '/data/bug-10771.php'], []);
12921296
}
12931297

1298+
public function testBug8636(): void
1299+
{
1300+
$this->analyse([__DIR__ . '/data/bug-8636.php'], []);
1301+
}
1302+
12941303
}

0 commit comments

Comments
 (0)