@@ -292,7 +292,7 @@ |
||
| 292 | 292 | * |
| 293 | 293 | * Returns false if there was no error. |
| 294 | 294 | * |
| 295 | - * @return string|bool |
|
| 295 | + * @return string|false |
|
| 296 | 296 | */ |
| 297 | 297 | public function error() |
| 298 | 298 | { |
@@ -239,8 +239,8 @@ discard block |
||
| 239 | 239 | $split = explode('\\', $class); |
| 240 | 240 | $class = end($split); |
| 241 | 241 | |
| 242 | - return preg_replace_callback('/([A-Z])/', function ($matches) { |
|
| 243 | - return '_' . strtolower($matches[1]); |
|
| 242 | + return preg_replace_callback('/([A-Z])/', function($matches) { |
|
| 243 | + return '_'.strtolower($matches[1]); |
|
| 244 | 244 | }, lcfirst($class)); |
| 245 | 245 | } |
| 246 | 246 | |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | */ |
| 253 | 253 | protected function prepareForeignKey($class) |
| 254 | 254 | { |
| 255 | - return $this->delimitClass($class) . '_id'; |
|
| 255 | + return $this->delimitClass($class).'_id'; |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | /** |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | |
| 421 | 421 | foreach (static::arrayify($instances) as $instance) { |
| 422 | 422 | if (!$instance instanceof $class) { |
| 423 | - throw new Exception('Related models must be an instance of ' . $class); |
|
| 423 | + throw new Exception('Related models must be an instance of '.$class); |
|
| 424 | 424 | } |
| 425 | 425 | } |
| 426 | 426 | } |
@@ -758,7 +758,7 @@ discard block |
||
| 758 | 758 | |
| 759 | 759 | // Filter the IDs to associate and dissociate if any have been given |
| 760 | 760 | if (!empty($ids)) { |
| 761 | - $filter = function ($instance) use ($ids) { |
|
| 761 | + $filter = function($instance) use ($ids) { |
|
| 762 | 762 | return in_array($instance->id(), $ids); |
| 763 | 763 | }; |
| 764 | 764 | |
@@ -772,7 +772,7 @@ discard block |
||
| 772 | 772 | } |
| 773 | 773 | |
| 774 | 774 | // Dissociate, then associate |
| 775 | - if (!empty($detached)) { |
|
| 775 | + if (!empty($detached)) { |
|
| 776 | 776 | $this->dissociate($detached); |
| 777 | 777 | } |
| 778 | 778 | |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | */ |
| 92 | 92 | public function get($attribute) |
| 93 | 93 | { |
| 94 | - list($attribute, $subattribute) = array_pad(explode('.', $attribute, 2), 2, null); |
|
| 94 | + list($attribute, $subattribute) = array_pad(explode('.', $attribute, 2), 2, null); |
|
| 95 | 95 | |
| 96 | 96 | if ($this->hasRelation($attribute)) { |
| 97 | 97 | $related = $this->related($attribute); |
@@ -157,9 +157,9 @@ discard block |
||
| 157 | 157 | $split = explode('\\', get_class($this)); |
| 158 | 158 | $class = end($split); |
| 159 | 159 | |
| 160 | - return preg_replace_callback('/([A-Z])/', function ($matches) { |
|
| 161 | - return '_' . strtolower($matches[1]); |
|
| 162 | - }, lcfirst($class)) . 's'; |
|
| 160 | + return preg_replace_callback('/([A-Z])/', function($matches) { |
|
| 161 | + return '_'.strtolower($matches[1]); |
|
| 162 | + }, lcfirst($class)).'s'; |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | /** |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | $storage = $instance->storage(); |
| 414 | 414 | |
| 415 | 415 | if (!$storage instanceof Searchable) { |
| 416 | - throw new Exception(get_class($instance) . ' storage is not searchable'); |
|
| 416 | + throw new Exception(get_class($instance).' storage is not searchable'); |
|
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | $attributes = $attributes ?: $instance->defaultSearchAttributes(); |
@@ -478,13 +478,13 @@ discard block |
||
| 478 | 478 | $storage = $instance->storage(); |
| 479 | 479 | |
| 480 | 480 | if (!$storage instanceof Queryable) { |
| 481 | - throw new Exception(get_class($instance) . ' storage is not queryable'); |
|
| 481 | + throw new Exception(get_class($instance).' storage is not queryable'); |
|
| 482 | 482 | } |
| 483 | 483 | |
| 484 | 484 | $query = new Query($instance->table()); |
| 485 | 485 | $builder = new Builder($query, $storage); |
| 486 | 486 | |
| 487 | - $builder->callback(function ($result) use ($instance) { |
|
| 487 | + $builder->callback(function($result) use ($instance) { |
|
| 488 | 488 | return $instance::hydrate($result->data); |
| 489 | 489 | }); |
| 490 | 490 | |
@@ -565,7 +565,7 @@ discard block |
||
| 565 | 565 | |
| 566 | 566 | // Storage must be modifiable in order to save |
| 567 | 567 | if (!$storage instanceof Modifiable) { |
| 568 | - throw new Exception($class . ' storage is not modifiable'); |
|
| 568 | + throw new Exception($class.' storage is not modifiable'); |
|
| 569 | 569 | } |
| 570 | 570 | |
| 571 | 571 | // Create or update the model in storage |