PhpCsFixer\ToolInfo::isInstalledByComposer PHP Method

isInstalledByComposer() public static method

public static isInstalledByComposer ( )
    public static function isInstalledByComposer()
    {
        static $result;
        if (null === $result) {
            $result = !self::isInstalledAsPhar() && file_exists(self::getScriptDir() . self::COMPOSER_INSTALLED_FILE);
        }
        return $result;
    }

Usage Example

Esempio 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::isInstalledByComposer