@@ -33,7 +33,7 @@ public function indexAction(): never
33
33
{
34
34
$ this ->assertPermission ('notifications/api/v1 ' );
35
35
$ request = $ this ->getRequest ();
36
- if (!$ request ->isApiRequest () && strtolower ($ request ->getParam ('endpoint ' )) !== ApiCore::OPENAPI_ENDPOINT ) {
36
+ if (! $ request ->isApiRequest () && strtolower ($ request ->getParam ('endpoint ' )) !== ApiCore::OPENAPI_ENDPOINT ) {
37
37
$ this ->httpBadRequest ('No API request ' );
38
38
}
39
39
@@ -69,14 +69,14 @@ private function dispatchEndpoint(Request $request, Response $response): void
69
69
$ className = sprintf ('Icinga \\%sApi \\%s \\%s ' , $ module , $ version , $ endpoint );
70
70
71
71
// Check if the required class and method are available and valid
72
- if (!class_exists ($ className ) || (new ReflectionClass ($ className ))->isAbstract ()) {
72
+ if (! class_exists ($ className ) || (new ReflectionClass ($ className ))->isAbstract ()) {
73
73
$ this ->httpNotFound (404 , "Endpoint $ endpoint does not exist. " );
74
74
}
75
75
76
76
// TODO: move this to an api core or version class?
77
77
$ parsedMethodName = ($ method === 'GET ' && empty ($ identifier )) ? $ methodName . 'Any ' : $ methodName ;
78
78
79
- if (!in_array ($ parsedMethodName , get_class_methods ($ className ))) {
79
+ if (! in_array ($ parsedMethodName , get_class_methods ($ className ))) {
80
80
if ($ method === 'GET ' && in_array ($ methodName , get_class_methods ($ className ))) {
81
81
$ parsedMethodName = $ methodName ;
82
82
} else {
@@ -105,7 +105,7 @@ private function getValidatedJsonContent(Request $request): array
105
105
$ msgPrefix = 'Invalid request body: ' ;
106
106
107
107
if (
108
- !preg_match ('/([^;]*);?/ ' , $ request ->getHeader ('Content-Type ' ), $ matches )
108
+ ! preg_match ('/([^;]*);?/ ' , $ request ->getHeader ('Content-Type ' ), $ matches )
109
109
|| $ matches [1 ] !== 'application/json '
110
110
) {
111
111
$ this ->httpBadRequest ($ msgPrefix . 'Content-Type must be application/json ' );
0 commit comments