@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | |
95 | 95 | public function use(string $resource): self |
96 | 96 | { |
97 | - if (! $this->resources->pluck('name')->contains($resource)) { |
|
97 | + if (!$this->resources->pluck('name')->contains($resource)) { |
|
98 | 98 | throw new ResourceNotRegistered("No resource registered for: {$resource}"); |
99 | 99 | } |
100 | 100 | |
@@ -103,14 +103,14 @@ discard block |
||
103 | 103 | return $this; |
104 | 104 | } |
105 | 105 | |
106 | - public function getResource():? array |
|
106 | + public function getResource(): ? array |
|
107 | 107 | { |
108 | 108 | return $this->resource; |
109 | 109 | } |
110 | 110 | |
111 | 111 | public function get(string $method = 'GET') |
112 | 112 | { |
113 | - if (! $this->checkAbility('get')) { |
|
113 | + if (!$this->checkAbility('get')) { |
|
114 | 114 | throw new MethodNotAllowed("Method get is not available on this resource"); |
115 | 115 | } |
116 | 116 | |
@@ -119,16 +119,16 @@ discard block |
||
119 | 119 | |
120 | 120 | public function find($identifier, string $method = 'GET') |
121 | 121 | { |
122 | - if (! $this->checkAbility('find')) { |
|
122 | + if (!$this->checkAbility('find')) { |
|
123 | 123 | throw new MethodNotAllowed("Method find is not available on this resource"); |
124 | 124 | } |
125 | 125 | |
126 | - return $this->call($method, $this->resource['endpoint'] . '/' . (string) $identifier); |
|
126 | + return $this->call($method, $this->resource['endpoint'].'/'.(string) $identifier); |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | public function create(array $data) |
130 | 130 | { |
131 | - if (! $this->checkAbility('create')) { |
|
131 | + if (!$this->checkAbility('create')) { |
|
132 | 132 | throw new MethodNotAllowed("Method create is not available on this resource"); |
133 | 133 | } |
134 | 134 | |
@@ -137,20 +137,20 @@ discard block |
||
137 | 137 | |
138 | 138 | public function update($identifier, array $data, string $method = 'PUT') |
139 | 139 | { |
140 | - if (! $this->checkAbility('update')) { |
|
140 | + if (!$this->checkAbility('update')) { |
|
141 | 141 | throw new MethodNotAllowed("Method update is not available on this resource"); |
142 | 142 | } |
143 | 143 | |
144 | - return $this->call($method, $this->resource['endpoint'] . '/' . (string) $identifier, $data); |
|
144 | + return $this->call($method, $this->resource['endpoint'].'/'.(string) $identifier, $data); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | public function delete($identifier, string $method = 'DELETE') |
148 | 148 | { |
149 | - if (! $this->checkAbility('delete')) { |
|
149 | + if (!$this->checkAbility('delete')) { |
|
150 | 150 | throw new MethodNotAllowed("Method delete is not available on this resource"); |
151 | 151 | } |
152 | 152 | |
153 | - return $this->call($method, $this->resource['endpoint'] . '/' . (string) $identifier); |
|
153 | + return $this->call($method, $this->resource['endpoint'].'/'.(string) $identifier); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | /** |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | $uri = ''; |
190 | 190 | |
191 | 191 | if ($this->getScheme() !== '') { |
192 | - $uri .= $this->getScheme() . '://'; |
|
192 | + $uri .= $this->getScheme().'://'; |
|
193 | 193 | } |
194 | 194 | |
195 | 195 | if ($this->getHost() !== '') { |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | |
199 | 199 | $uri .= rtrim($this->getPath(), '/'); |
200 | 200 | |
201 | - $uri .= '/' . rtrim($endpoint, '/'); |
|
201 | + $uri .= '/'.rtrim($endpoint, '/'); |
|
202 | 202 | |
203 | 203 | return $uri; |
204 | 204 | } |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | { |
211 | 211 | $scheme = strtolower($scheme); |
212 | 212 | |
213 | - if (! in_array($scheme, $this->allowedSchemes)) { |
|
213 | + if (!in_array($scheme, $this->allowedSchemes)) { |
|
214 | 214 | throw new UnsupportedScheme( |
215 | 215 | "The scheme `{$scheme}` isn't valid. It should be either `http` or `https`." |
216 | 216 | ); |