PhpCsFixer\ToolInfo::isInstalledAsPhar PHP Method

isInstalledAsPhar() public static method

public static isInstalledAsPhar ( )
    public static function isInstalledAsPhar()
    {
        static $result;
        if (null === $result) {
            $result = 'phar://' === substr(__DIR__, 0, 7);
        }
        return $result;
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @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();
 }
All Usage Examples Of PhpCsFixer\ToolInfo::isInstalledAsPhar