@@ -50,17 +50,26 @@ public function isAllowedMethod(string $requestMethod):bool {
5050 return $ this ->isMethodAllowed ($ requestMethod , $ allowedMethods );
5151 }
5252
53- private function getAllowedMethods (): array {
53+ /** @return array<string> */
54+ private function getAllowedMethods ():array {
5455 $ methodsArgument = $ this ->attribute ->getArguments ()["methods " ] ?? [];
5556 return $ this ->mapAttributeToMethods ($ this ->attribute ->getName (), $ methodsArgument );
5657 }
5758
58- private function mapAttributeToMethods (string $ attributeName , array $ methodsArgument ): array {
59+ /**
60+ * @param array<string> $methodsArgument
61+ * @return array<string>
62+ */
63+ private function mapAttributeToMethods (
64+ string $ attributeName ,
65+ array $ methodsArgument ,
66+ ):array {
5967 $ attributeMethodMap = $ this ->getAttributeMethodMap ();
6068 return $ attributeMethodMap [$ attributeName ] ?? $ methodsArgument ;
6169 }
6270
63- private function getAttributeMethodMap (): array {
71+ /** @return array<class-string, array<string>> */
72+ private function getAttributeMethodMap ():array {
6473 return [
6574 Any::class => HttpRoute::METHODS_ALL ,
6675 Connect::class => [HttpRoute::METHOD_CONNECT ],
@@ -75,11 +84,21 @@ private function getAttributeMethodMap(): array {
7584 ];
7685 }
7786
78- private function normalizeMethods (array $ methods ): array {
87+ /**
88+ * @param array<string> $methods
89+ * @return array<string>
90+ */
91+ private function normalizeMethods (array $ methods ):array {
7992 return array_map ("strtoupper " , $ methods );
8093 }
8194
82- private function isMethodAllowed (string $ requestMethod , array $ allowedMethods ): bool {
95+ /**
96+ * @param array<string> $allowedMethods
97+ */
98+ private function isMethodAllowed (
99+ string $ requestMethod ,
100+ array $ allowedMethods ,
101+ ):bool {
83102 return in_array (strtoupper ($ requestMethod ), $ allowedMethods , true );
84103 }
85104
0 commit comments