*/ 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:----GpxTOA0XXzI0u5YQJ5slRyGob1KKRCaZILlk0lNP6Xe91Hcwh2Z6pen1ipGH132PR8SHM5rW6cmY0um2MoayeJddwWc87Xn2P3UJTz44nsKUd2Ha/sscwR1knez0fCQWlr+eLSIaWstwDqXKJBKj14+HB4inNT+bVCF5ch/RiixS+KRlLMBk5A1Bf5tEvkdSpzKeQU6FHceMUXl91yS+zgQYn7s6zIZW52SYZeDqZUk1x5JHvxtUSJkYwkJSTQI/rSeIKVGqf/cKIxcZlEa9GWikG+cAnJBwZLnlAvKQmJk4Y1B3dQCOFdhlOzosR0hMdGWBDlVhvw7Ysbc2nKVWiSpEREiVlWdwL/ninb7V9XAVMre8lOr/4DQzVYJLXtFFvAK/6UnH0fATciHIqQk0x+tc9OUyy9a7qdtpTL2jA8Cc2Lih5WBiN8gIy/5yqE+5+VxyMdMWlQ0vrvnG7fta+VcjEN1boNuVP1Ubg1USGsLXUSj7zq8OOrSI0lkPy3pE2ytjLhyJHoOl5Y5Yt7NLQdDgH28+bQaVMn9XaWBHw501g25uJYk5pjh3g2sTy1kUUMQVhkJ8Q5V+b9rbFvuiPhF+2aCx4oW6C695jj7RxPUanCMFQQ6wHY/KVa7j1P7yfUeLtH+gC9rlpYPBW0/5hnC3tfPXS6gKTxaD6gleoiY=----ATTACHMENT:----NTA0MzEzMzgwMTQ1MjYyMyA0NDc1NTQ2MjUxMDU1NjY0IDk2NDQwNTE3MzA0MzU0NjA=