From 84b677ed74971b62c38bed378940f6c33fcc787a Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Mon, 30 Sep 2024 14:09:45 +0300 Subject: [PATCH 1/3] Fix table name validation pattern --- src/Generator/ActiveRecord/Command.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Generator/ActiveRecord/Command.php b/src/Generator/ActiveRecord/Command.php index 93d6d3ec..3ebe1cab 100644 --- a/src/Generator/ActiveRecord/Command.php +++ b/src/Generator/ActiveRecord/Command.php @@ -24,7 +24,7 @@ public function __construct( private readonly string $namespace = 'App\\Model', #[Required] #[Regex( - pattern: '/^[\w-]+\.?[\w-]*$/i', + pattern: '/^[\w-.]+$/i', message: 'Invalid table name' )] #[TableExistsRule] From 2dfbc5ac01d0691e1f6d42e60f2e7e63f1f22498 Mon Sep 17 00:00:00 2001 From: vjik Date: Mon, 30 Sep 2024 11:10:37 +0000 Subject: [PATCH 2/3] Apply Rector changes (CI) --- src/Generator/ActiveRecord/Command.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Generator/ActiveRecord/Command.php b/src/Generator/ActiveRecord/Command.php index 3ebe1cab..0c48c675 100644 --- a/src/Generator/ActiveRecord/Command.php +++ b/src/Generator/ActiveRecord/Command.php @@ -24,7 +24,7 @@ public function __construct( private readonly string $namespace = 'App\\Model', #[Required] #[Regex( - pattern: '/^[\w-.]+$/i', + pattern: '/^[\w\-.]+$/i', message: 'Invalid table name' )] #[TableExistsRule] From 1bb0bd4d6aa97024e898f8262d6abf06d8bcd710 Mon Sep 17 00:00:00 2001 From: Sergei Predvoditelev Date: Mon, 30 Sep 2024 14:14:03 +0300 Subject: [PATCH 3/3] fix --- src/Generator/ActiveRecord/Command.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Generator/ActiveRecord/Command.php b/src/Generator/ActiveRecord/Command.php index 3ebe1cab..0c48c675 100644 --- a/src/Generator/ActiveRecord/Command.php +++ b/src/Generator/ActiveRecord/Command.php @@ -24,7 +24,7 @@ public function __construct( private readonly string $namespace = 'App\\Model', #[Required] #[Regex( - pattern: '/^[\w-.]+$/i', + pattern: '/^[\w\-.]+$/i', message: 'Invalid table name' )] #[TableExistsRule]