File tree 5 files changed +13
-21
lines changed
5 files changed +13
-21
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,7 @@ class Controller extends AbstractActionController
17
17
/** @var ServerUrl */
18
18
protected $ serverUrlViewHelper ;
19
19
20
- /** @var BasePath|null */
21
- private $ basePath ;
20
+ private ?BasePath $ basePath ;
22
21
23
22
public function __construct (ApiFactory $ apiFactory , ServerUrl $ serverUrlViewHelper , ?BasePath $ basePath = null )
24
23
{
Original file line number Diff line number Diff line change @@ -24,9 +24,8 @@ public function __invoke(Service $service)
24
24
}
25
25
26
26
$ view = $ this ->getView ();
27
- $ types = array_map (function ($ type ) use ($ view ) {
28
- return sprintf ('<div class="list-group-item">%s</div> ' , $ view ->escapeHtml ($ type ));
29
- }, $ requestAcceptTypes );
27
+ $ types = array_map (static fn ($ type ) =>
28
+ sprintf ('<div class="list-group-item">%s</div> ' , $ view ->escapeHtml ($ type )), $ requestAcceptTypes );
30
29
return implode ("\n" , $ types );
31
30
}
32
31
}
Original file line number Diff line number Diff line change @@ -24,9 +24,8 @@ public function __invoke(Service $service)
24
24
}
25
25
26
26
$ view = $ this ->getView ();
27
- $ types = array_map (function ($ type ) use ($ view ) {
28
- return sprintf ('<div class="list-group-item">%s</div> ' , $ view ->escapeHtml ($ type ));
29
- }, $ requestContentTypes );
27
+ $ types = array_map (static fn ($ type ) =>
28
+ sprintf ('<div class="list-group-item">%s</div> ' , $ view ->escapeHtml ($ type )), $ requestContentTypes );
30
29
return implode ("\n" , $ types );
31
30
}
32
31
}
Original file line number Diff line number Diff line change @@ -15,13 +15,11 @@ class AgStatusCodes extends AbstractHelper
15
15
public function __invoke (Operation $ operation )
16
16
{
17
17
$ view = $ this ->getView ();
18
- $ statusCodes = array_map (function ($ status ) use ($ view ) {
19
- return sprintf (
20
- '<li class="list-group-item"><strong>%s:</strong> %s</li> ' ,
21
- $ view ->escapeHtml ($ status ['code ' ]),
22
- $ view ->escapeHtml ($ status ['message ' ])
23
- );
24
- }, $ operation ->getResponseStatusCodes ());
18
+ $ statusCodes = array_map (static fn ($ status ) => sprintf (
19
+ '<li class="list-group-item"><strong>%s:</strong> %s</li> ' ,
20
+ $ view ->escapeHtml ($ status ['code ' ]),
21
+ $ view ->escapeHtml ($ status ['message ' ])
22
+ ), $ operation ->getResponseStatusCodes ());
25
23
26
24
return sprintf ("<ul class= \"list-group \"> \n%s \n</ul> \n" , implode ("\n" , $ statusCodes ));
27
25
}
Original file line number Diff line number Diff line change 16
16
17
17
class ControllerTest extends TestCase
18
18
{
19
- /** @var MvcEvent */
20
- private $ event ;
19
+ private MvcEvent $ event ;
21
20
22
- /** @var ServerUrl */
23
- private $ serverUrl ;
21
+ private ServerUrl $ serverUrl ;
24
22
25
- /** @var BasePath */
26
- private $ basePath ;
23
+ private BasePath $ basePath ;
27
24
28
25
/** @var ApiFactory|PHPUnit_Framework_MockObject_MockObject */
29
26
private $ apiFactory ;
You can’t perform that action at this time.
0 commit comments