From 7e0ba5f80c11656a723c6de132f2b5ddf7712c3d Mon Sep 17 00:00:00 2001 From: Matthias Vogel Date: Thu, 23 Mar 2023 16:09:12 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20allow=20dev-main=20for=20typo3/cms-?= =?UTF-8?q?core?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/RectorSettings.php | 1 + src/VersionUtility.php | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/RectorSettings.php b/src/RectorSettings.php index 7d7595a..290ff35 100644 --- a/src/RectorSettings.php +++ b/src/RectorSettings.php @@ -101,6 +101,7 @@ public static function setsTypo3(bool $entirety = false): array $setList = $entirety ? Typo3LevelSetList::UP_TO_TYPO3_11 : Typo3SetList::TYPO3_11; break; case 12: + case 'dev-main': $setList = $entirety ? Typo3LevelSetList::UP_TO_TYPO3_12 : Typo3SetList::TYPO3_12; break; } diff --git a/src/VersionUtility.php b/src/VersionUtility.php index 2330ac1..6746519 100644 --- a/src/VersionUtility.php +++ b/src/VersionUtility.php @@ -82,7 +82,11 @@ private static function getMinimalVersion(string $packageName): ?string } $parser = new VersionParser(); - $lowestVersion = $parser->parseConstraints($versionConstrain)->getLowerBound()->getVersion(); + $constraint = $parser->parseConstraints($versionConstrain); + $lowestVersion = $constraint->getLowerBound()->getVersion(); + if ($lowestVersion === '0.0.0.0-dev') { + return explode('#', $parser->normalize($versionConstrain), 2)[0]; + } if (!preg_match('#(?\d+)\.(?\d+)\..*#', $lowestVersion, $matches)) { return null; }