diff --git a/composer.json b/composer.json index 50855437..f2138adb 100644 --- a/composer.json +++ b/composer.json @@ -38,6 +38,7 @@ "yiisoft/active-record": "dev-master", "yiisoft/aliases": "^3.0", "yiisoft/arrays": "^2.1|^3.0", + "yiisoft/csrf": "^2.1.1", "yiisoft/data-response": "^2.0", "yiisoft/db": "*", "yiisoft/friendly-exception": "^1.1", @@ -48,7 +49,7 @@ "yiisoft/json": "^1.0", "yiisoft/router": "^3.0", "yiisoft/strings": "^2.1", - "yiisoft/validator": "^1.0", + "yiisoft/validator": "^2.0", "yiisoft/yii-console": "^2.0", "yiisoft/yii-middleware": "^1.0" }, diff --git a/src/Controller/DefaultController.php b/src/Controller/DefaultController.php index cce96e35..71b6e50e 100644 --- a/src/Controller/DefaultController.php +++ b/src/Controller/DefaultController.php @@ -142,7 +142,7 @@ public function diff( private function createErrorResponse(InvalidGeneratorCommandException $e): DataResponse { return $this->responseFactory->createResponse( - ['errors' => $e->getResult()->getErrorMessagesIndexedByAttribute()], + ['errors' => $e->getResult()->getErrorMessagesIndexedByProperty()], Status::UNPROCESSABLE_ENTITY ); } diff --git a/src/Validator/ClassExistsRule.php b/src/Validator/ClassExistsRule.php index 4528ffd8..d3ab6781 100644 --- a/src/Validator/ClassExistsRule.php +++ b/src/Validator/ClassExistsRule.php @@ -11,11 +11,6 @@ #[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)] final class ClassExistsRule implements RuleInterface { - public function getName(): string - { - return 'gii_class_exists'; - } - public function getHandler(): string|RuleHandlerInterface { return ClassExistsHandler::class; diff --git a/src/Validator/NewClassRule.php b/src/Validator/NewClassRule.php index cda0b4a7..dbc0447b 100644 --- a/src/Validator/NewClassRule.php +++ b/src/Validator/NewClassRule.php @@ -11,11 +11,6 @@ #[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)] final class NewClassRule implements RuleInterface { - public function getName(): string - { - return 'gii_new_class'; - } - public function getHandler(): string|RuleHandlerInterface { return NewClassHandler::class; diff --git a/src/Validator/ReservedKeywordRule.php b/src/Validator/ReservedKeywordRule.php index 3f92c664..7bb2458b 100644 --- a/src/Validator/ReservedKeywordRule.php +++ b/src/Validator/ReservedKeywordRule.php @@ -11,11 +11,6 @@ #[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)] final class ReservedKeywordRule implements RuleInterface { - public function getName(): string - { - return 'gii_reserved_keyword'; - } - public function getHandler(): string|RuleHandlerInterface { return ReservedKeywordHandler::class; diff --git a/src/Validator/TableExistsRule.php b/src/Validator/TableExistsRule.php index 1f5a3ef7..ca5a442c 100644 --- a/src/Validator/TableExistsRule.php +++ b/src/Validator/TableExistsRule.php @@ -11,11 +11,6 @@ #[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)] final class TableExistsRule implements RuleInterface { - public function getName(): string - { - return 'gii_table_exists'; - } - public function getHandler(): string|RuleHandlerInterface { return TableExistsHandler::class; diff --git a/src/Validator/TemplateRule.php b/src/Validator/TemplateRule.php index 06e73c03..798c3c46 100644 --- a/src/Validator/TemplateRule.php +++ b/src/Validator/TemplateRule.php @@ -11,11 +11,6 @@ #[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)] final class TemplateRule implements RuleInterface { - public function getName(): string - { - return 'gii_template_rule'; - } - public function getHandler(): string|RuleHandlerInterface { return TemplateRuleHandler::class;