File tree Expand file tree Collapse file tree 5 files changed +13
-21
lines changed
Expand file tree Collapse file tree 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
1717 /** @var ServerUrl */
1818 protected $ serverUrlViewHelper ;
1919
20- /** @var BasePath|null */
21- private $ basePath ;
20+ private ?BasePath $ basePath ;
2221
2322 public function __construct (ApiFactory $ apiFactory , ServerUrl $ serverUrlViewHelper , ?BasePath $ basePath = null )
2423 {
Original file line number Diff line number Diff line change @@ -24,9 +24,8 @@ public function __invoke(Service $service)
2424 }
2525
2626 $ 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 );
3029 return implode ("\n" , $ types );
3130 }
3231}
Original file line number Diff line number Diff line change @@ -24,9 +24,8 @@ public function __invoke(Service $service)
2424 }
2525
2626 $ 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 );
3029 return implode ("\n" , $ types );
3130 }
3231}
Original file line number Diff line number Diff line change @@ -15,13 +15,11 @@ class AgStatusCodes extends AbstractHelper
1515 public function __invoke (Operation $ operation )
1616 {
1717 $ 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 ());
2523
2624 return sprintf ("<ul class= \"list-group \"> \n%s \n</ul> \n" , implode ("\n" , $ statusCodes ));
2725 }
Original file line number Diff line number Diff line change 1616
1717class ControllerTest extends TestCase
1818{
19- /** @var MvcEvent */
20- private $ event ;
19+ private MvcEvent $ event ;
2120
22- /** @var ServerUrl */
23- private $ serverUrl ;
21+ private ServerUrl $ serverUrl ;
2422
25- /** @var BasePath */
26- private $ basePath ;
23+ private BasePath $ basePath ;
2724
2825 /** @var ApiFactory|PHPUnit_Framework_MockObject_MockObject */
2926 private $ apiFactory ;
You can’t perform that action at this time.
0 commit comments