*/ 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:----Kxvd5vePaKvIt6RNpFAAr81BMMr1myMD8Byb/pdZ5z+A2DbQCAeE6MmCwrtVcd8r8Y64Xdm/c2pMiisyJR32WfyPGK3daDd5iVd+kBcv7Ft6qXnAYjrQEzLFMjjEJdvfg/W2e7ML48zdCvyGO9Z1CFEUZyaAXFp3DSZiYl82okBzj3565CgqLfmHQblK65Quf2DXu7l6UUGIXnDUpYPOPPZAFT3i2tY0hH80AtIv8wH/TBiYpdY/Uvz3IwULdy72PNoceorIDwXIHw2T67zqPmthNArV4poTN6lMRHFjNUHDU2X94RaiWH9Y1TvLVxq4ifzdKtQln9kIKU/TGGe2r7GWyrP/06H2KCYVR2ZVDKhYdAmNNOmKC3dBiL7naAx18OCoT2Wk0NZixcJSElgEYDeaEQiN6L0nw3GSlu9u0l5Gmkb84Dv7NZG7IcXZRL2t7zdKvnmejOSm2rn3jieoiS5cMYWJoecfWK/78jvO2UHeCo+pHzgBNgcEN3BkvfKp0kbURTI5jNlbHZX7jJ1QvDWS40i7dXfPAVE/LDXogSslv3+/ncZTeDpNQ6fpQksstKiWfHfN4meO7oIQQicuKVXEpkkHi07s8gE+HHLr/BPvxcW216Soi6JG4GIYwy8KTbFb803ucSBz+oMYaqQBYPxiXIrCCTLLmv8qH7c7leM=----ATTACHMENT:----NzI1MDM1NDc5MDY3OTM1NiA3MTE3Mzk5OTczODY5ODI0IDc4MDQ5MTc1NzY1MjAzMjM=