From c4a9f73aad2c9a7487a615beae993d17d888dee1 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Wed, 15 Jan 2025 17:53:20 +0100 Subject: [PATCH] Fix putting the class-opening bracket on its own line --- templates/controller/Controller.tpl.php | 1 + templates/controller/test/Test.tpl.php | 1 + templates/crud/controller/Controller.tpl.php | 1 + templates/crud/test/Test.EntityManager.tpl.php | 1 + templates/security/Voter.tpl.php | 1 + templates/validator/Constraint.tpl.php | 1 + templates/validator/Validator.tpl.php | 1 + 7 files changed, 7 insertions(+) diff --git a/templates/controller/Controller.tpl.php b/templates/controller/Controller.tpl.php index 9d9948457..4974ae748 100644 --- a/templates/controller/Controller.tpl.php +++ b/templates/controller/Controller.tpl.php @@ -5,6 +5,7 @@ getUseStatements(); ?> getClassDeclaration(); ?> + { generateRouteForControllerMethod($route_path, $route_name); ?> public function (): ResponseJsonResponse diff --git a/templates/controller/test/Test.tpl.php b/templates/controller/test/Test.tpl.php index 802fcc694..8441cbe26 100644 --- a/templates/controller/test/Test.tpl.php +++ b/templates/controller/test/Test.tpl.php @@ -5,6 +5,7 @@ getUseStatements(); ?> getClassDeclaration(); ?> + { public function testIndex(): void { diff --git a/templates/crud/controller/Controller.tpl.php b/templates/crud/controller/Controller.tpl.php index 0a4a84d55..63901dc58 100644 --- a/templates/crud/controller/Controller.tpl.php +++ b/templates/crud/controller/Controller.tpl.php @@ -6,6 +6,7 @@ #[Route('')] getClassDeclaration() ?> + { generateRouteForControllerMethod('', sprintf('%s_index', $route_name), ['GET']) ?> diff --git a/templates/crud/test/Test.EntityManager.tpl.php b/templates/crud/test/Test.EntityManager.tpl.php index 031a8cb6e..78f074180 100644 --- a/templates/crud/test/Test.EntityManager.tpl.php +++ b/templates/crud/test/Test.EntityManager.tpl.php @@ -6,6 +6,7 @@ getUseStatements(); ?> getClassDeclaration() ?> + { private KernelBrowser $client; private EntityManagerInterface $manager; diff --git a/templates/security/Voter.tpl.php b/templates/security/Voter.tpl.php index 431b3c585..2488efd38 100644 --- a/templates/security/Voter.tpl.php +++ b/templates/security/Voter.tpl.php @@ -5,6 +5,7 @@ getUseStatements(); ?> getClassDeclaration() ?> + { public const EDIT = 'POST_EDIT'; public const VIEW = 'POST_VIEW'; diff --git a/templates/validator/Constraint.tpl.php b/templates/validator/Constraint.tpl.php index 414c19eeb..0a3144595 100644 --- a/templates/validator/Constraint.tpl.php +++ b/templates/validator/Constraint.tpl.php @@ -6,6 +6,7 @@ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_METHOD | \Attribute::IS_REPEATABLE)] getClassDeclaration(); ?> + { public string $message = 'The string "{{ string }}" contains an illegal character: it can only contain letters or numbers.'; diff --git a/templates/validator/Validator.tpl.php b/templates/validator/Validator.tpl.php index ef711e888..b8f33b6db 100644 --- a/templates/validator/Validator.tpl.php +++ b/templates/validator/Validator.tpl.php @@ -5,6 +5,7 @@ getUseStatements(); ?> getClassDeclaration(); ?> + { public function validate(mixed $value, Constraint $constraint): void {