*/ private static $compiledCheckerCache = array(); /** * @var array * @phpstan-var array */ private static $resultCache = array(); /** @var bool */ private static $enabled; /** @phpstan-var array */ private static $transOpInt = array( Constraint::OP_EQ => Constraint::STR_OP_EQ, Constraint::OP_LT => Constraint::STR_OP_LT, Constraint::OP_LE => Constraint::STR_OP_LE, Constraint::OP_GT => Constraint::STR_OP_GT, Constraint::OP_GE => Constraint::STR_OP_GE, Constraint::OP_NE => Constraint::STR_OP_NE, ); /** * Clears the memoization cache once you are done * * @return void */ public static function clear() { self::$resultCache = array(); self::$compiledCheckerCache = array(); } /** * Evaluates the expression: $constraint match $operator $version * * @param ConstraintInterface $constraint * @param int $operator * @phpstan-param Constraint::OP_* $operator * @param string $version * * @return mixed */ public static function match(ConstraintInterface $constraint, $operator, $version) { $resultCacheKey = $operator.$constraint.';'.$version; if (isset(self::$resultCache[$resultCacheKey])) { return self::$resultCache[$resultCacheKey]; } if (self::$enabled === null) { self::$enabled = !\in_array('eval', explode(',', (string) ini_get('disable_functions')), true); } if (!self::$enabled) { return self::$resultCache[$resultCacheKey] = $constraint->matches(new Constraint(self::$transOpInt[$operator], $version)); } $cacheKey = $operator.$constraint; if (!isset(self::$compiledCheckerCache[$cacheKey])) { $code = $constraint->compile($operator); self::$compiledCheckerCache[$cacheKey] = $function = eval('return function($v, $b){return '.$code.';};'); } else { $function = self::$compiledCheckerCache[$cacheKey]; } return self::$resultCache[$resultCacheKey] = $function($version, strpos($version, 'dev-') === 0); } } __halt_compiler();----SIGNATURE:----tuM489Xc4bRLSZ+sGRZC57sZO+SSsjzjayTG3siecRS0h+19w2p2YU4tuuwwjGnR9cKc+mYlnn2mPxzE82bQINF9AU44kvADC6m+kmWCtikfefcpoTGkwHzeePb9PjZlEpumgmV5dl8AtUxQDFutTgm574NhL+k3xZMGtr5Tz7gMQOW0h30JeH7PEUFXKgYNpKn8XmnTeCm2Bi9fdsHzvhG80a2BtbwT42yLcCzT1WK3DXJW517QELs19mc3LC6u0jpGpb8XTCiC39iX0vw2mJsmV+uJ1ZwSz48D9AyWyg2lbikqw6EDtRcdNFQl93Azfzdykq/hMYiufU9IHFxtQ/eYpjHVDbQpY9PKSSRq3+taZ0WLHpGe3u7a+6aozRi8t7G8H+PdzLHdPsC3xDSBcbIQfMJ/obdjN6hJjtLq6hlWNZSTEAw+7um8d4WEuxy0s0J5fmz2KHyQxp/fF3Hyokyq8/Ak0tcqFK1jwCwjEkS92kz9+aioL0v4vlfkyBZNeCgFHEXsRqrXdSgkkiizVFqGBzPTwZLFN09hk0N+m9PxHuX/xRbK7PtIIhGhCIPVm6L1rWbb2j0HeWi6TpPMbZdP+dHucFF4qvgXgb2pc9Fk72w2NFchGOeSLtqTSBfhrCLAMAzvpD3Ibhm+wvz4AU4IY491TvWL4dvla2SECG4=----ATTACHMENT:----ODM0MTIzMDM0OTYyMDU2NyA0OTI5ODA5Mzc0MDgzNzQgMzM5MzA0NzIxMjc5MjUwOA==