*/ 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:----vQQAkYxiSclarQvmjgCuBR+qAi1fcHgjhqFSyvFOzUfKA0olB7sSj9hZ95sd3zMGO6KgfkddjhfqWfUNlx0+pNk5XbrIfpFE3xV5OD90jTQ9/1Z+sW3CgZDDQ4mAbGsiKfRn0aMabSgWdgtmWCuBfZ8Uewt5S3zJ3LGZkF2mzsmsocvVI/43su+KWx7Ob4n1LUHwN12nOW+zjtlaGgNUFCTTKz1T/SBGCBKRAiFvF5zXTFAwkwLThVV8NkBY1CF6wsRRujytO9fUGVacE6e5Z/Vjt7eossysZWeO+9x9CIrJwlhugJ2Ld+7h6ejyY4IzkEjoZqfoyWCMWcAG2x4NxzHN7sZ7dyLzJvTIoy5KF7rVnVbR83xULFAES43AIoAi0GTT+VB2cCzHy9R8MO8A7ng6kIdpC8FTg7xxBcg6KF6w0ZxMc1a0WhOFQwrsgAICEKWp2Yn/X7+GJXrEdUSjsGMRmbCp8Pj5XzSfe6wEUquh7Vh5Y0uHgD0hJvtrovAxVdm40dtBNgxknd2NfgkNlcUWtYbn5Fati+M/SjJzZIz5KCudNnfSbO0IBPlwQ1W16Foc5dkNjN+Mxnv2vEkOwxIkkAqD956Wbsux1SriRX/x/4X7nux35XI01xjWUHrRmigHqHJwJI4jVHV2vVWVsGcr7GsyTq1EPOlpVQQ7Vtc=----ATTACHMENT:----NTY3NzYzNzY0NDYwMTU5MCAxMjE5NTgwNzA5OTYwOTQ3IDk0NTMwODA3NjEzNjQyNjQ=