*/ 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:----GIAq+rlimQFkK7jiGPCxQ82vkpZ5J9TLeqElu54jXgNPYOMS+dnjfr4yRdt6u5k7Xei5r5EfI2Gt+53DlRqZ7hoyTQTsIpBnDedXoQWuLQKvDMZioxiiyteEd5SgcWTnuNE+rCZ/sxJDVVyS8/1mgGU7b0uV8XV8n1hHWlX5hf2h1upriZrfd0MePcs6KnUQtqjQ74re9UB+V3qy86llvRqFiGEgCWPEOwKaO2yfwqt+2PHzcoZkVG6LhPALR87cHfu+Abms9/pp8XVgxk1l/2VbLgSb5fOmdwLfpTYDK7hTMyBj261LECClkSEAlgyI/3qVX1fa5OUfBYwWXq4hylfp4Hhjx5vmkdBciVyoNNlkk2JP0RsqOuvmIJt/AiTEsV2OdKUcOWwOba3PmYJV2Xs84USUCPq0HWCeYtPQWtlsscT7Acm/sA4pkI3beeSSinaSpn9uarDrEjoUop/yPmZ7QZeKZxrFoIaKUhGa1LVnswiFknfF3IWrtiJLR4UO6XXpUU5MeBQlH/HE6KloYiJTErBeb0lUeg+9v2d6dQKrYdn9y5uYNsud4HrvfKowASnFfR0mqgY2pf/9V+hdbkWyGRZtx4wb3TVzSbWVyivFLz3Y1U75aQJN0Ka865jFKazn5enVcugP90FJnmgei6Giuc/age5V8fpj97VGAcI=----ATTACHMENT:----OTY4MTQ5OTYzNTA3MDAzNyAyMTk4NzQxOTU0NTk2ODE2IDYzMjEzMTE3NjkwNjgxOQ==