@@ -58,32 +58,32 @@ |
||
58 | 58 | } |
59 | 59 | |
60 | 60 | if ($unwrap) { |
61 | - return json_decode($content, true)['data'] ?? json_decode($content, true); |
|
61 | + return json_decode($content, true)[ 'data' ] ?? json_decode($content, true); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | return json_decode($content, true); |
65 | 65 | } |
66 | 66 | |
67 | - protected function http(string $method, string $route, array $payload = []) |
|
67 | + protected function http(string $method, string $route, array $payload = [ ]) |
|
68 | 68 | { |
69 | 69 | return $this->sendRequest($method, $route, $payload, true); |
70 | 70 | } |
71 | 71 | |
72 | - private function sendRequest(string $method, string $route, array $payload = [], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse |
|
72 | + private function sendRequest(string $method, string $route, array $payload = [ ], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse |
|
73 | 73 | { |
74 | 74 | return $this->json($method, env('API_URL').'/'.$route, $payload, $authenticated ? [ |
75 | 75 | 'Authorization' => 'Bearer '.$this->getAuth0Service()->getTestUserToken()->id_token, |
76 | - ] : []); |
|
76 | + ] : [ ]); |
|
77 | 77 | } |
78 | 78 | |
79 | - protected function sendRequestWithToken($token, string $method, string $route, array $payload = [], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse |
|
79 | + protected function sendRequestWithToken($token, string $method, string $route, array $payload = [ ], $authenticated = true): \Illuminate\Foundation\Testing\TestResponse |
|
80 | 80 | { |
81 | 81 | return $this->json($method, env('API_URL').'/'.$route, $payload, $authenticated ? [ |
82 | 82 | 'Authorization' => 'Bearer '.$token, |
83 | - ] : []); |
|
83 | + ] : [ ]); |
|
84 | 84 | } |
85 | 85 | |
86 | - protected function httpNoAuth(string $method, string $route, array $payload = []) |
|
86 | + protected function httpNoAuth(string $method, string $route, array $payload = [ ]) |
|
87 | 87 | { |
88 | 88 | return $this->sendRequest($method, $route, $payload, false); |
89 | 89 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | |
32 | 32 | protected function includeRelations() |
33 | 33 | { |
34 | - $relations = []; |
|
34 | + $relations = [ ]; |
|
35 | 35 | foreach ($this->relations as $relation) { |
36 | 36 | if (is_string($relation) && method_exists(static::class, 'transform'.ucfirst(strtolower($relation)))) { |
37 | 37 | $method = 'transform'.ucfirst(strtolower($relation)); |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | if ($data instanceof JsonResource) { |
40 | 40 | $data->jsonSerialize(); |
41 | 41 | } |
42 | - $relations[strtolower($relation)] = $data; |
|
42 | + $relations[ strtolower($relation) ] = $data; |
|
43 | 43 | } else { |
44 | 44 | throw new \Exception('invalid relation or not relation_transform_method given in '.get_short_class_name(static::class)); |
45 | 45 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | return static::$caching; |
31 | 31 | } |
32 | 32 | |
33 | - public static function find($id, $columns = ['*']) |
|
33 | + public static function find($id, $columns = [ '*' ]) |
|
34 | 34 | { |
35 | 35 | if (static::cache()->enabled()) { |
36 | 36 | $model = static::cache()->find($id) ?? static::recache($id); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | return $model; |
50 | 50 | } |
51 | 51 | |
52 | - public static function findWithoutCache($id, $columns = ['*']) |
|
52 | + public static function findWithoutCache($id, $columns = [ '*' ]) |
|
53 | 53 | { |
54 | 54 | $model = new static(); |
55 | 55 | if (is_array($id) || $id instanceof Arrayable) { |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | return; |
66 | 66 | } |
67 | 67 | |
68 | - if ($columns !== ['*']) { |
|
68 | + if ($columns !== [ '*' ]) { |
|
69 | 69 | return collect($model)->first($columns); |
70 | 70 | } |
71 | 71 |