clean install

This commit is contained in:
matze committed 2024-12-10 15:08:16 +01:00
commit e14eb2d8fd
31193 files changed
+3555714

No files matched your search

@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace DrupalCodeGenerator\Validator;
/**
* Validates required machine name.
*/
final class MachineName {
/**
* @throws \UnexpectedValueException
*/
public function __invoke(mixed $value): string {
if (!\is_string($value) || !\preg_match('/^[a-z][a-z0-9_]*[a-z0-9]$/', $value)) {
throw new \UnexpectedValueException('The value is not correct machine name.');
}
return $value;
}
}