From 386c18701ff066ef1aad4f5433fd72ae0e4467e0 Mon Sep 17 00:00:00 2001 From: Flohw Date: Thu, 7 Mar 2024 10:13:36 +0100 Subject: [PATCH 1/3] Allow request and file params to be on class --- Controller/Annotations/FileParam.php | 2 +- Controller/Annotations/RequestParam.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Controller/Annotations/FileParam.php b/Controller/Annotations/FileParam.php index 33b7fe8c2..a2188dc1d 100644 --- a/Controller/Annotations/FileParam.php +++ b/Controller/Annotations/FileParam.php @@ -26,7 +26,7 @@ * * @author Ener-Getick */ -#[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_METHOD)] +#[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_METHOD | \Attribute::TARGET_CLASS)] class FileParam extends AbstractParam { /** @var bool */ diff --git a/Controller/Annotations/RequestParam.php b/Controller/Annotations/RequestParam.php index 34252149b..a0b01b964 100644 --- a/Controller/Annotations/RequestParam.php +++ b/Controller/Annotations/RequestParam.php @@ -23,7 +23,7 @@ * @author Jordi Boggiano * @author Boris Guéry */ -#[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_METHOD)] +#[\Attribute(\Attribute::IS_REPEATABLE | \Attribute::TARGET_METHOD | \Attribute::TARGET_CLASS)] class RequestParam extends AbstractScalarParam { /** @var bool */ From 7e605ccc54e2332131f15acc03f407fda55734c5 Mon Sep 17 00:00:00 2001 From: Flohw Date: Thu, 7 Mar 2024 10:18:23 +0100 Subject: [PATCH 2/3] Add annotation for compatibility --- Controller/Annotations/FileParam.php | 1 + Controller/Annotations/RequestParam.php | 1 + 2 files changed, 2 insertions(+) diff --git a/Controller/Annotations/FileParam.php b/Controller/Annotations/FileParam.php index a2188dc1d..3812a35ed 100644 --- a/Controller/Annotations/FileParam.php +++ b/Controller/Annotations/FileParam.php @@ -23,6 +23,7 @@ * @Annotation * @NamedArgumentConstructor * @Target("METHOD") + * @Target("CLASS") * * @author Ener-Getick */ diff --git a/Controller/Annotations/RequestParam.php b/Controller/Annotations/RequestParam.php index a0b01b964..c360c4bfd 100644 --- a/Controller/Annotations/RequestParam.php +++ b/Controller/Annotations/RequestParam.php @@ -19,6 +19,7 @@ * @Annotation * @NamedArgumentConstructor * @Target("METHOD") + * @Target("CLASS") * * @author Jordi Boggiano * @author Boris Guéry From 721e8216e00d3901c238233f5a07cdf3efccb419 Mon Sep 17 00:00:00 2001 From: Florian Date: Fri, 8 Mar 2024 15:52:00 +0000 Subject: [PATCH 3/3] Fix Target annotation --- Controller/Annotations/FileParam.php | 3 +-- Controller/Annotations/RequestParam.php | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Controller/Annotations/FileParam.php b/Controller/Annotations/FileParam.php index 3812a35ed..15e8bad9b 100644 --- a/Controller/Annotations/FileParam.php +++ b/Controller/Annotations/FileParam.php @@ -22,8 +22,7 @@ * * @Annotation * @NamedArgumentConstructor - * @Target("METHOD") - * @Target("CLASS") + * @Target({"METHOD", "CLASS"}) * * @author Ener-Getick */ diff --git a/Controller/Annotations/RequestParam.php b/Controller/Annotations/RequestParam.php index c360c4bfd..dc45f45aa 100644 --- a/Controller/Annotations/RequestParam.php +++ b/Controller/Annotations/RequestParam.php @@ -18,8 +18,7 @@ * * @Annotation * @NamedArgumentConstructor - * @Target("METHOD") - * @Target("CLASS") + * @Target({"METHOD", "CLASS"}) * * @author Jordi Boggiano * @author Boris Guéry