public static function isInstalledAsPhar()
{
static $result;
if (null === $result) {
$result = 'phar://' === substr(__DIR__, 0, 7);
}
return $result;
}
/** * @param ConfigInterface $config * @param bool $isDryRun * * @return CacheManagerInterface */ private function createCacheManager(ConfigInterface $config, $isDryRun) { if ($config->usingCache() && (ToolInfo::isInstalledAsPhar() || ToolInfo::isInstalledByComposer())) { return new FileCacheManager(new FileHandler($config->getCacheFile()), new Signature(PHP_VERSION, ToolInfo::getVersion(), $config->usingLinter(), $config->getRules()), $isDryRun); } return new NullCacheManager(); }