diff --git a/composer.json b/composer.json index 25dac358..e8dda3c2 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ ], "require": { "php": ">=8.0 <8.3", - "nette/utils": "^3.2.7 || ^4.0" + "nette/utils": "^3.2.9 || ^4.0" }, "require-dev": { "nette/tester": "^2.4", diff --git a/src/PhpGenerator/Helpers.php b/src/PhpGenerator/Helpers.php index 3cd4a10c..0439bcb2 100644 --- a/src/PhpGenerator/Helpers.php +++ b/src/PhpGenerator/Helpers.php @@ -169,16 +169,7 @@ public static function validateType(?string $type, bool &$nullable): ?string { if ($type === '' || $type === null) { return null; - } - - if (!preg_match(<<<'XX' - ~(?n) - ( - \?? (? [\w\\]+)| - (? (?&type) (& (?&type))+ )| - (? (?&type) | \( (?&intersection) \) ) (\| (?&upart) )+ - )$~xAD - XX, $type)) { + } elseif (!Nette\Utils\Validators::isTypeDeclaration($type)) { throw new Nette\InvalidArgumentException("Value '$type' is not valid type."); }