]> BookStack Code Mirror - bookstack/blobdiff - tests/Api/TestsApi.php
Apply fixes from StyleCI
[bookstack] / tests / Api / TestsApi.php
index 1ad4d14b64e4c7137134552848b1f7c800dbed6f..683ca0c747a022a31c829f9ea2359feadf4e6e44 100644 (file)
@@ -1,8 +1,9 @@
-<?php namespace Tests\Api;
+<?php
+
+namespace Tests\Api;
 
 trait TestsApi
 {
-
     protected $apiTokenId = 'apitoken';
     protected $apiTokenSecret = 'password';
 
@@ -12,6 +13,7 @@ trait TestsApi
     protected function actingAsApiEditor()
     {
         $this->actingAs($this->getEditor(), 'api');
+
         return $this;
     }
 
@@ -20,7 +22,7 @@ trait TestsApi
      */
     protected function errorResponse(string $message, int $code): array
     {
-        return ["error" => ["code" => $code, "message" => $message]];
+        return ['error' => ['code' => $code, 'message' => $message]];
     }
 
     /**
@@ -29,18 +31,19 @@ trait TestsApi
      */
     protected function validationResponse(array $messages): array
     {
-        $err = $this->errorResponse("The given data was invalid.", 422);
+        $err = $this->errorResponse('The given data was invalid.', 422);
         $err['error']['validation'] = $messages;
+
         return $err;
     }
+
     /**
      * Get an approved API auth header.
      */
     protected function apiAuthHeader(): array
     {
         return [
-            "Authorization" => "Token {$this->apiTokenId}:{$this->apiTokenSecret}"
+            'Authorization' => "Token {$this->apiTokenId}:{$this->apiTokenSecret}",
         ];
     }
-
-}
\ No newline at end of file
+}