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 1414use PHPStan \Analyser \Error ;
1515use PHPStan \Analyser \IgnoredErrorHelper ;
1616use PHPStan \Analyser \ResultCache \ResultCacheManagerFactory ;
17- use PHPStan \File \CouldNotReadFileException ;
1817use PHPStan \File \FileMonitor ;
1918use PHPStan \File \FileMonitorResult ;
2019use PHPStan \File \FileReader ;
6160use function React \Promise \resolve ;
6261use function sprintf ;
6362use function strlen ;
64- use function strpos ;
6563use function unlink ;
6664use const PHP_BINARY ;
6765use const PHP_URL_PORT ;
@@ -461,17 +459,7 @@ private function reanalyseAfterFileChanges(
461459
462460 private function isDockerRunning (): bool
463461 {
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 ' );
475463 }
476464
477465}
You can’t perform that action at this time.
0 commit comments