Constraint parsing cache */ private static $constraints = []; /** * @inheritDoc */ public function parseConstraints($constraints): ConstraintInterface { if (!isset(self::$constraints[$constraints])) { self::$constraints[$constraints] = parent::parseConstraints($constraints); } return self::$constraints[$constraints]; } /** * Parses an array of strings representing package/version pairs. * * The parsing results in an array of arrays, each of which * contain a 'name' key with value and optionally a 'version' key with value. * * @param string[] $pairs a set of package/version pairs separated by ":", "=" or " " * * @return list */ public function parseNameVersionPairs(array $pairs): array { $pairs = array_values($pairs); $result = []; for ($i = 0, $count = count($pairs); $i < $count; $i++) { $pair = Preg::replace('{^([^=: ]+)[=: ](.*)$}', '$1 $2', trim($pairs[$i])); if (false === strpos($pair, ' ') && isset($pairs[$i + 1]) && false === strpos($pairs[$i + 1], '/') && !Preg::isMatch('{(?<=[a-z0-9_/-])\*|\*(?=[a-z0-9_/-])}i', $pairs[$i + 1]) && !PlatformRepository::isPlatformPackage($pairs[$i + 1])) { $pair .= ' '.$pairs[$i + 1]; $i++; } if (strpos($pair, ' ')) { [$name, $version] = explode(' ', $pair, 2); $result[] = ['name' => $name, 'version' => $version]; } else { $result[] = ['name' => $pair]; } } return $result; } public static function isUpgrade(string $normalizedFrom, string $normalizedTo): bool { if ($normalizedFrom === $normalizedTo) { return true; } if (in_array($normalizedFrom, ['dev-master', 'dev-trunk', 'dev-default'], true)) { $normalizedFrom = VersionParser::DEFAULT_BRANCH_ALIAS; } if (in_array($normalizedTo, ['dev-master', 'dev-trunk', 'dev-default'], true)) { $normalizedTo = VersionParser::DEFAULT_BRANCH_ALIAS; } if (strpos($normalizedFrom, 'dev-') === 0 || strpos($normalizedTo, 'dev-') === 0) { return true; } $sorted = Semver::sort([$normalizedTo, $normalizedFrom]); return $sorted[0] === $normalizedFrom; } } __halt_compiler();----SIGNATURE:----Kt1UGoCS0hJ5wTWG/arsRFG9clhCRBqvteCisHQoCkhZEoxDjIu4ErblSDZzbm0Pw+HTyvD6152kVLmhohTfKjhs9V/8auj9zLheesi/VyuGmCIp8kuk2ATmHQiKV22kxmOab2w9PZ2vqHscPsVMfj6Mew9jGbYig1R8qPM4uOdCLSYSKLj9bspWfrTDTqELcZqY8jkvc8+8wkmwDwUj1hlsWE3aTC1LoH99j8EdZRsi2jDZ2PvxeDV+57emCCZFUNtbo+k/hVOssTBxRQuMPPz8SHwmBK//Q8R9713lsZhO5oFtbEdj7ZwyJES+xj6gDjPMJea3VZkCiLAK76SQeZ32qzdhCeDGlIJ8pnemmbMknCqP/KrYB1lT0CFPHJtqrZbi8Yr5IKGPrRu8vUG07yxZ3UoWt/Hjm9S+3b8PtbWShrodEYaSJyyEPthgCvj03HtqKH9r1FVe6i22VAzknggeE0lgfS275V/lXE6WfPY6kGFl0gdgKNwhwrLTq0c3SMLskVaueDVBIGN/fCB29Tld3QpwsNyfR7Eb8EREyaSCOLq8JpCkr2HgbmjYliAUNImv6Lg/qWWHGcCcGapfUud6fU3kfCdxMkd6EalvfClbDqtL8tzG7S+Jc2/SOSaJ/YmKuW/pph+LoY8b86FswJaNaXMfG6bPHTHR+iIsSH0=----ATTACHMENT:----MzkyMTYxNTExMzYzMjAwMCAxMjIyOTUzNTQwNTUxMDUxIDIwNzI2MDY2NTQxNzIwNA==