![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/cartforge.co/vendor/phpmd/phpmd/src/main/php/PHPMD/Cache/ |
<?php namespace PHPMD\Cache; use PHPMD\Cache\Model\ResultCacheKey; use PHPMD\Cache\Model\ResultCacheState; class ResultCacheStateFactory { /** * @param string $filePath * @return ResultCacheState|null */ public function fromFile($filePath) { if (file_exists($filePath) === false) { return null; } $resultCache = require $filePath; if (isset($resultCache['state'], $resultCache['key']) === false) { return null; } $cacheKey = $this->createCacheKey($resultCache['key']); if ($cacheKey === null) { return null; } return new ResultCacheState($cacheKey, $resultCache['state']); } /** * @return ResultCacheKey|null */ private function createCacheKey(array $data) { if (array_key_exists('strict', $data) === false || array_key_exists('baselineHash', $data) === false || array_key_exists('rules', $data) === false || array_key_exists('composer', $data) === false || array_key_exists('phpVersion', $data) === false ) { return null; } return new ResultCacheKey( $data['strict'], $data['baselineHash'], $data['rules'], $data['composer'], $data['phpVersion'] ); } }