Skip to content

Commit 46c7db1

Browse files
committed
change symfony kernel version comparison mechanism
1 parent d2551d8 commit 46c7db1

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

Diff for: Utility/Framework/SymfonyFramework.php

+4-14
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
use Symfony\Component\HttpKernel\Kernel;
1515

16+
/**
17+
* @internal
18+
*/
1619
class SymfonyFramework
1720
{
1821
/**
@@ -75,19 +78,6 @@ public static function isKernelLessThan($major, $minor = null, $patch = null)
7578
*/
7679
private static function kernelVersionCompare($operator, $major, $minor = null, $patch = null)
7780
{
78-
$vernum = $major;
79-
$kernel = Kernel::MAJOR_VERSION;
80-
81-
if ($minor) {
82-
$vernum .= '.'.$minor;
83-
$kernel .= '.'.Kernel::MINOR_VERSION;
84-
85-
if ($patch) {
86-
$vernum .= '.'.$patch;
87-
$kernel .= '.'.Kernel::RELEASE_VERSION;
88-
}
89-
}
90-
91-
return version_compare($kernel, $vernum, $operator);
81+
return version_compare(Kernel::VERSION_ID, sprintf("%d%'.02d%'.02d", $major, $minor ?: 0, $patch ?: 0), $operator);
9282
}
9383
}

0 commit comments

Comments
 (0)