refactor(console, id, config): Dialog mode in Console, consolidated id modul, added config support for ini directives
This commit is contained in:
20
src/Framework/Id/Ulid/UlidValidator.php
Normal file
20
src/Framework/Id/Ulid/UlidValidator.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Framework\Id\Ulid;
|
||||
|
||||
/**
|
||||
* Validiert ULID-Strings.
|
||||
*/
|
||||
final readonly class UlidValidator
|
||||
{
|
||||
/**
|
||||
* @param string $ulid
|
||||
* @return bool true, wenn $ulid exakt 26 Zeichen Crockford-Base32 sind
|
||||
*/
|
||||
public function isValid(string $ulid): bool
|
||||
{
|
||||
return (bool) preg_match('/^[0-9A-HJKMNP-TV-Z]{26}$/', $ulid);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user