*/ private static $compiledCheckerCache = []; /** * @var array * @phpstan-var array */ private static $resultCache = []; /** @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 bool */ 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:----qfj7D5F1YpzKwzYRaiO34qnyVJ59y+x5ufDkpLxyH7jErbTMa/UJ2vgzdlmeKSlr/Z5pN2NwEcD6vje0nI+0VDH1/g54Us1cC76WY9QHXUtkdGr5EsDALx8qSjLQfIGmGSziC7mb8wSUN/Cao9wl7LMFVODaeQSafhBWBcBYVO2X+4f+dnB6G2NdGaC7kJcn7ATXbpHxOZBpiuNNvDPLwxIxFL+0WkzVNplYKMBxa/c629ciW/OUy7VnsVcLcq1ERjfWGky2XcQI2RvdiCqfk+1NUKMpzXQB/qdrBOa9ncZ8xAV10zFNziUykzH/7sGiFEvzIc1ZixGo02Q4uTwSwIeWPL1SSWfk0t2OR3ZHGLodR3T24KrWYEk3aKM3nouNihM0GBaDpy617e6JGB9H4BPADsWukAUBFJXxuEl0osAjoHvpwKUy2780Px1f1CTgcJ0U152O/1++CwA+wVZWRiN6i1AWKtQ3gfeWQ3YX8ooEU9rza/LrsIC94BfQrrSiINCKbN7PIkCo6eZVHXIOG9BEcwzNqb0dqRX6kVMi0RG7S1PAkv7qIG3J4KaOUQfLdyD3R2FHf5+yTlLRYxxKJLwR69YFU0ZEa+tzZ0JMMGXKmOFCCkir5flC8JJBfgLQWbRA/4f1C2HIhqMrx0r+AjZ3SplVIAdP6bB+pCpAsaQ=----ATTACHMENT:----Mjg3NjYwOTc5MTQxMDEyMyA4MzQ0NTM0OTU0NTQwMDk4IDc2Nzg5NDIxNDg4MDI2NjQ=