button fix, kernel update
This commit is contained in:
16
kernel/helpers/Version.php
Normal file
16
kernel/helpers/Version.php
Normal 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),
|
||||
};
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user