@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | /** Update */ |
253 | 253 | if (!empty($this->data->$primary)) { |
254 | 254 | $id = $this->data->$primary; |
255 | - if(!$this->update($this->safe(), "{$this->primary} = :id", "id={$id}")) { |
|
255 | + if (!$this->update($this->safe(), "{$this->primary} = :id", "id={$id}")) { |
|
256 | 256 | return false; |
257 | 257 | } |
258 | 258 | } |
@@ -294,10 +294,10 @@ discard block |
||
294 | 294 | */ |
295 | 295 | protected function required(): bool |
296 | 296 | { |
297 | - $data = (array)$this->data(); |
|
297 | + $data = (array) $this->data(); |
|
298 | 298 | foreach ($this->required as $field) { |
299 | - if (empty($data[$field])) { |
|
300 | - if(!is_int($data[$field])){ |
|
299 | + if (empty($data[ $field ])) { |
|
300 | + if (!is_int($data[ $field ])) { |
|
301 | 301 | return false; |
302 | 302 | } |
303 | 303 | } |
@@ -310,8 +310,8 @@ discard block |
||
310 | 310 | */ |
311 | 311 | protected function safe(): ?array |
312 | 312 | { |
313 | - $safe = (array)$this->data; |
|
314 | - unset($safe[$this->primary]); |
|
313 | + $safe = (array) $this->data; |
|
314 | + unset($safe[ $this->primary ]); |
|
315 | 315 | return $safe; |
316 | 316 | } |
317 | 317 | |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | protected function toCamelCase(string $string): string |
324 | 324 | { |
325 | 325 | $camelCase = str_replace(' ', '', ucwords(str_replace('_', ' ', $string))); |
326 | - $camelCase[0] = strtolower($camelCase[0]); |
|
326 | + $camelCase[ 0 ] = strtolower($camelCase[ 0 ]); |
|
327 | 327 | return $camelCase; |
328 | 328 | } |
329 | 329 | } |