Skip to content

Commit f111a67

Browse files
committed
simplify
1 parent bd5c255 commit f111a67

File tree

2 files changed

+3
-11
lines changed

2 files changed

+3
-11
lines changed

src/DependencyInjection/ContainerFactory.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
use PHPStan\BetterReflection\SourceLocator\Type\SourceLocator;
2525
use PHPStan\Command\CommandHelper;
2626
use PHPStan\File\FileHelper;
27-
use PHPStan\File\FilesystemHelper;
2827
use PHPStan\Node\Printer\Printer;
2928
use PHPStan\Php\PhpVersion;
3029
use PHPStan\Reflection\PhpVersionStaticAccessor;
@@ -48,7 +47,6 @@
4847
use function spl_object_id;
4948
use function sprintf;
5049
use function str_ends_with;
51-
use function strtoupper;
5250
use function substr;
5351

5452
/**
@@ -192,8 +190,6 @@ public static function postInitializeContainer(Container $container): void
192190
$container->getService('typeSpecifier');
193191

194192
BleedingEdgeToggle::setBleedingEdge($container->getParameter('featureToggles')['bleedingEdge']);
195-
// filename intentional in wrong case
196-
FilesystemHelper::setIsCaseSensitive(is_file(__DIR__ . '/' . strtoupper(__FILE__)));
197193
}
198194

199195
public function getCurrentWorkingDirectory(): string

src/File/FilesystemHelper.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
namespace PHPStan\File;
44

5-
use PHPStan\ShouldNotHappenException;
5+
use function is_file;
6+
use function strtoupper;
67

78
final class FilesystemHelper
89
{
@@ -12,14 +13,9 @@ final class FilesystemHelper
1213
public static function isCaseSensitive(): bool
1314
{
1415
if (self::$isCaseSensitive === null) {
15-
throw new ShouldNotHappenException();
16+
self::$isCaseSensitive = is_file(__DIR__ . '/' . strtoupper(__FILE__));
1617
}
1718
return self::$isCaseSensitive;
1819
}
1920

20-
public static function setIsCaseSensitive(bool $isCaseSensitive): void
21-
{
22-
self::$isCaseSensitive = $isCaseSensitive;
23-
}
24-
2521
}

0 commit comments

Comments
 (0)