@@ -33,7 +33,7 @@ public function indexAction(): never
3333 {
3434 $ this ->assertPermission ('notifications/api/v1 ' );
3535 $ 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 ) {
3737 $ this ->httpBadRequest ('No API request ' );
3838 }
3939
@@ -69,14 +69,14 @@ private function dispatchEndpoint(Request $request, Response $response): void
6969 $ className = sprintf ('Icinga \\%sApi \\%s \\%s ' , $ module , $ version , $ endpoint );
7070
7171 // 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 ()) {
7373 $ this ->httpNotFound (404 , "Endpoint $ endpoint does not exist. " );
7474 }
7575
7676 // TODO: move this to an api core or version class?
7777 $ parsedMethodName = ($ method === 'GET ' && empty ($ identifier )) ? $ methodName . 'Any ' : $ methodName ;
7878
79- if (!in_array ($ parsedMethodName , get_class_methods ($ className ))) {
79+ if (! in_array ($ parsedMethodName , get_class_methods ($ className ))) {
8080 if ($ method === 'GET ' && in_array ($ methodName , get_class_methods ($ className ))) {
8181 $ parsedMethodName = $ methodName ;
8282 } else {
@@ -105,7 +105,7 @@ private function getValidatedJsonContent(Request $request): array
105105 $ msgPrefix = 'Invalid request body: ' ;
106106
107107 if (
108- !preg_match ('/([^;]*);?/ ' , $ request ->getHeader ('Content-Type ' ), $ matches )
108+ ! preg_match ('/([^;]*);?/ ' , $ request ->getHeader ('Content-Type ' ), $ matches )
109109 || $ matches [1 ] !== 'application/json '
110110 ) {
111111 $ this ->httpBadRequest ($ msgPrefix . 'Content-Type must be application/json ' );
0 commit comments