*/ 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:----n6/ckXu2Ycu7Skb6b7P7j0ZvTjJpmTeHxw69e1YupG7tGtlyxMkrPaO2H9kwvunEhYXDjRd6ekZv4o+B2+K7gtGwenjf6b3LpasR3X9pfXMIlmNnp9da6CHl4hJVNht4LPQUXDiGAbJM8suonst1jG3ezIay4U2gOpG/TY9WWJN1hna+cow6DmfQ3eZYKXQm0F6x1SEuWO5IJXRo7p7Py8vQnAfrwdV9i8NT/k5bPBWbtBmFGQ1BtwKeRS6ajhpQ6G/qnm3B5PpRBYHxajmheaMXxOwI27TYx30LJey+Rt4QBoSGJA+BQPk4eRgdJQzGSeq2Zp3mt0X82PGTapdBGR+9i12rsaqDdH6/Bhm8cE1rwe0qb1buD5OKAHEdBCuRphpCu0mFIQP7Pdg60yZ0ACWO4df55GTRgZVFevDhJiFQcWPLsjqzzUBVyUeXXSVB5C0AtHprbVRr0yf76xt1bdCtW8sCTU5x/SxNVl1+yO3wyr0jlTX1zJH3ESGNBcaCdX708BHw2Rn7hAA78/U6x9vMvnQMOvd0kaKAAk3RVxjKGPELW8GRBSUdx8dfVQCpsrArChjpzuR9g8PT9YUZ2SNjSNA2tVDeKXKVNI0h6F2NeyP0ej5GzBryoPhyzc1/8okEHl+QD4DtxXgp7mVg0jvO9v2KvC4a9lvzXc86bvQ=----ATTACHMENT:----OTk3Mjg0ODYzMTAxMzAxMyAxODE2OTQxNzg0MTE1NDQgNzAwNDkxNDg3Nzk3MjczNw==