@@ -57,8 +57,15 @@ public function testInjectsNothingIfContentTypeHeaderIsMissing(): void
5757 $ this ->assertNull ($ this ->listener ->onRoute ($ this ->event ));
5858 }
5959
60- /** @return array */
61- public function validDefaultContentTypes ()
60+ /**
61+ * @psalm-return array<array-key, array{
62+ * 0: string,
63+ * 1: string,
64+ * 2: int,
65+ * 3: string
66+ * }>
67+ */
68+ public function validDefaultContentTypes (): array
6269 {
6370 return [
6471 [
@@ -78,16 +85,13 @@ public function validDefaultContentTypes()
7885
7986 /**
8087 * @dataProvider validDefaultContentTypes
81- *
82- * @param string $header
83- * @param string $vendor
84- * @param int $version
85- * @param string $resource
86- *
87- * @return void
8888 */
89- public function testInjectsRouteMatchesWhenContentTypeMatchesDefaultRegexp ($ header , $ vendor , $ version , $ resource ): void
90- {
89+ public function testInjectsRouteMatchesWhenContentTypeMatchesDefaultRegexp (
90+ string $ header ,
91+ string $ vendor ,
92+ int $ version ,
93+ string $ resource
94+ ): void {
9195 $ request = $ this ->event ->getRequest ();
9296 $ headers = $ request ->getHeaders ();
9397 $ headers ->addHeaderLine ('Content-Type ' , $ header );
@@ -99,8 +103,8 @@ public function testInjectsRouteMatchesWhenContentTypeMatchesDefaultRegexp($head
99103 $ this ->assertEquals ($ resource , $ routeMatch ->getParam ('laminas_ver_resource ' , false ));
100104 }
101105
102- /** @return array */
103- public function invalidDefaultContentTypes ()
106+ /** @psalm- return array<string, array{0: string}> */
107+ public function invalidDefaultContentTypes (): array
104108 {
105109 return [
106110 'bad-prefix ' => ['application/vendor.mwop.v1.status ' ],
@@ -112,12 +116,8 @@ public function invalidDefaultContentTypes()
112116
113117 /**
114118 * @dataProvider invalidDefaultContentTypes
115- *
116- * @param string $header
117- *
118- * @return void
119119 */
120- public function testInjectsNothingIntoRouteMatchesWhenContentTypeDoesNotMatchDefaultRegexp ($ header ): void
120+ public function testInjectsNothingIntoRouteMatchesWhenContentTypeDoesNotMatchDefaultRegexp (string $ header ): void
121121 {
122122 $ request = $ this ->event ->getRequest ();
123123 $ headers = $ request ->getHeaders ();
@@ -130,8 +130,15 @@ public function testInjectsNothingIntoRouteMatchesWhenContentTypeDoesNotMatchDef
130130 $ this ->assertFalse ($ routeMatch ->getParam ('laminas_ver_resource ' , false ));
131131 }
132132
133- /** @return array */
134- public function validCustomContentTypes ()
133+ /**
134+ * @psalm-return array<array-key, array{
135+ * 0: string,
136+ * 1: string,
137+ * 2: int,
138+ * 3: string
139+ * }>
140+ */
141+ public function validCustomContentTypes (): array
135142 {
136143 return [
137144 [
@@ -151,16 +158,13 @@ public function validCustomContentTypes()
151158
152159 /**
153160 * @dataProvider validCustomContentTypes
154- *
155- * @param string $header
156- * @param string $vendor
157- * @param int $version
158- * @param string $resource
159- *
160- * @return void
161161 */
162- public function testWillInjectRouteMatchesWhenContentTypeMatchesCustomRegexp ($ header , $ vendor , $ version , $ resource ): void
163- {
162+ public function testWillInjectRouteMatchesWhenContentTypeMatchesCustomRegexp (
163+ string $ header ,
164+ string $ vendor ,
165+ int $ version ,
166+ string $ resource
167+ ): void {
164168 $ this ->listener ->addRegexp (
165169 '#application/vendor\.(?<vendor>mwop)\.(?<version>\d+)\.(?<resource>(?:user|status))# '
166170 );
@@ -176,8 +180,13 @@ public function testWillInjectRouteMatchesWhenContentTypeMatchesCustomRegexp($he
176180 $ this ->assertEquals ($ resource , $ routeMatch ->getParam ('resource ' , false ));
177181 }
178182
179- /** @return array */
180- public function mixedContentTypes ()
183+ /**
184+ * @psalm-return array<string, array{
185+ * 0: string,
186+ * 1: array<string, string|int>
187+ * }>
188+ */
189+ public function mixedContentTypes (): array
181190 {
182191 return [
183192 'default ' => [
@@ -201,13 +210,8 @@ public function mixedContentTypes()
201210
202211 /**
203212 * @dataProvider mixedContentTypes
204- *
205- * @param string $header
206- * @param array $matches
207- *
208- * @return void
209213 */
210- public function testWillInjectRouteMatchesForFirstRegexpToMatch ($ header , array $ matches ): void
214+ public function testWillInjectRouteMatchesForFirstRegexpToMatch (string $ header , array $ matches ): void
211215 {
212216 $ this ->listener ->addRegexp ('#application/vnd\.(?<vendor>mwop)\.(?<version>\d+)\.(?<resource>(?:user|status))# ' );
213217
0 commit comments