From fb541e83b75fc85faff338d1c3448525d3db9d78 Mon Sep 17 00:00:00 2001 From: Adriano Ferreira Date: Tue, 7 Jan 2020 07:51:58 -0200 Subject: [PATCH] fixup --- .idea/.gitignore | 2 ++ src/VersionParser.php | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 .idea/.gitignore diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 000000000..e7e9d11d4 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,2 @@ +# Default ignored files +/workspace.xml diff --git a/src/VersionParser.php b/src/VersionParser.php index 928455892..5af07b119 100644 --- a/src/VersionParser.php +++ b/src/VersionParser.php @@ -106,10 +106,10 @@ public function normalize($version, $fullVersion = null) $fullVersion = $version; } - if (preg_match('{^(\^[^,\s]++) ++as ++([^,\s\^]++)$}', $version, $match) || - preg_match('{^([^,\s]++) ++as ++(\^[^,\s\^]++)$}', $version, $match) || - preg_match('{^([^,\s]++) ++as ++(\~[^,\s\^]++)$}', $version, $match) || - preg_match('{^(\~[^,\s]++) ++as ++([^,\s\^]++)$}', $version, $match)) { + if (preg_match('{^(\^[^,\s]++) ++as ++([^,\s]++)$}', $version, $match) || + preg_match('{^([^,\s]++) ++as ++(\^[^,\s]++)$}', $version, $match) || + preg_match('{^([^,\s]++) ++as ++(\~[^,\s]++)$}', $version, $match) || + preg_match('{^(\~[^,\s]++) ++as ++([^,\s]++)$}', $version, $match)) { throw new \UnexpectedValueException('the alias must be an exact version'); }