version fix

This commit is contained in:
stasbilay02 committed 2024-12-18 15:24:25 +03:00
1 parent aa913293ef
commit a0a99de862
6 files changed
+59 -12

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
<?php
namespace kernel\helpers;
class Version
{
public static function getIntVersionByString(string $version): int
{
$version = preg_replace('/[^0-9]+/', '', $version);
return match (strlen($version)) {
1 => intval($version) * 100,
2 => intval($version) * 10,
3 => intval($version),
};
}
}