File tree Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Original file line number Diff line number Diff line change 14
14
use PHPStan \Analyser \Error ;
15
15
use PHPStan \Analyser \IgnoredErrorHelper ;
16
16
use PHPStan \Analyser \ResultCache \ResultCacheManagerFactory ;
17
- use PHPStan \File \CouldNotReadFileException ;
18
17
use PHPStan \File \FileMonitor ;
19
18
use PHPStan \File \FileMonitorResult ;
20
19
use PHPStan \File \FileReader ;
61
60
use function React \Promise \resolve ;
62
61
use function sprintf ;
63
62
use function strlen ;
64
- use function strpos ;
65
63
use function unlink ;
66
64
use const PHP_BINARY ;
67
65
use const PHP_URL_PORT ;
@@ -461,17 +459,7 @@ private function reanalyseAfterFileChanges(
461
459
462
460
private function isDockerRunning (): bool
463
461
{
464
- if (!is_file ('/proc/1/cgroup ' )) {
465
- return false ;
466
- }
467
-
468
- try {
469
- $ contents = FileReader::read ('/proc/1/cgroup ' );
470
-
471
- return strpos ($ contents , 'docker ' ) !== false ;
472
- } catch (CouldNotReadFileException ) {
473
- return false ;
474
- }
462
+ return is_file ('/.dockerenv ' );
475
463
}
476
464
477
465
}
You can’t perform that action at this time.
0 commit comments