@@ -105,8 +105,8 @@ discard block |
||
105 | 105 | */ |
106 | 106 | public static function registerExtensions($extensions) |
107 | 107 | { |
108 | - $extensions = array_map(function ($extension) { |
|
109 | - return '.' . ltrim(trim($extension), '.'); |
|
108 | + $extensions = array_map(function($extension) { |
|
109 | + return '.'.ltrim(trim($extension), '.'); |
|
110 | 110 | }, (array) $extensions); |
111 | 111 | |
112 | 112 | static::$extensions = array_merge(static::$extensions, $extensions); |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | |
223 | 223 | foreach ($extensions as $extension) { |
224 | 224 | if (static::$basePath) { |
225 | - $paths[] = static::$basePath . "/$path$extension"; |
|
225 | + $paths[] = static::$basePath."/$path$extension"; |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | $paths[] = "$path$extension"; |
@@ -123,7 +123,7 @@ |
||
123 | 123 | public function registerExtensions($extensions) |
124 | 124 | { |
125 | 125 | foreach ((array) $extensions as $extension) { |
126 | - $this->extensions[] = '.' . ltrim($extension, '.'); |
|
126 | + $this->extensions[] = '.'.ltrim($extension, '.'); |
|
127 | 127 | } |
128 | 128 | } |
129 | 129 |
@@ -21,7 +21,7 @@ |
||
21 | 21 | */ |
22 | 22 | public function transform($value, $type = '') |
23 | 23 | { |
24 | - $method = 'transform' . ucfirst($type); |
|
24 | + $method = 'transform'.ucfirst($type); |
|
25 | 25 | |
26 | 26 | if (method_exists($this, $method)) { |
27 | 27 | return $this->$method($value); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function get($attribute) |
91 | 91 | { |
92 | - list($attribute, $subattribute) = array_pad(explode('.', $attribute, 2), 2, null); |
|
92 | + list($attribute, $subattribute) = array_pad(explode('.', $attribute, 2), 2, null); |
|
93 | 93 | |
94 | 94 | if ($this->hasRelation($attribute)) { |
95 | 95 | $related = $this->related($attribute); |
@@ -155,9 +155,9 @@ discard block |
||
155 | 155 | $split = explode('\\', get_class($this)); |
156 | 156 | $class = end($split); |
157 | 157 | |
158 | - return preg_replace_callback('/([A-Z])/', function ($matches) { |
|
159 | - return '_' . strtolower($matches[1]); |
|
160 | - }, lcfirst($class)) . 's'; |
|
158 | + return preg_replace_callback('/([A-Z])/', function($matches) { |
|
159 | + return '_'.strtolower($matches[1]); |
|
160 | + }, lcfirst($class)).'s'; |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | /** |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | $storage = $instance->storage(); |
412 | 412 | |
413 | 413 | if (!$storage instanceof Searchable) { |
414 | - throw new Exception(get_class($instance) . ' storage is not searchable'); |
|
414 | + throw new Exception(get_class($instance).' storage is not searchable'); |
|
415 | 415 | } |
416 | 416 | |
417 | 417 | $attributes = $attributes ?: $instance->defaultSearchAttributes(); |
@@ -476,13 +476,13 @@ discard block |
||
476 | 476 | $storage = $instance->storage(); |
477 | 477 | |
478 | 478 | if (!$storage instanceof Queryable) { |
479 | - throw new Exception(get_class($instance) . ' storage is not queryable'); |
|
479 | + throw new Exception(get_class($instance).' storage is not queryable'); |
|
480 | 480 | } |
481 | 481 | |
482 | 482 | $query = new Query($instance->table()); |
483 | 483 | $builder = new Builder($query, $storage); |
484 | 484 | |
485 | - $builder->callback(function ($result) use ($instance) { |
|
485 | + $builder->callback(function($result) use ($instance) { |
|
486 | 486 | return $instance::hydrate($result->data); |
487 | 487 | }); |
488 | 488 | |
@@ -563,7 +563,7 @@ discard block |
||
563 | 563 | |
564 | 564 | // Storage must be modifiable in order to save |
565 | 565 | if (!$storage instanceof Modifiable) { |
566 | - throw new Exception($class . ' storage is not modifiable'); |
|
566 | + throw new Exception($class.' storage is not modifiable'); |
|
567 | 567 | } |
568 | 568 | |
569 | 569 | // Create or update the model in storage |
@@ -797,6 +797,6 @@ discard block |
||
797 | 797 | return $this->relation($method); |
798 | 798 | } |
799 | 799 | |
800 | - throw new Exception('Call to undefined method ' . get_class($this) . '::' . $method . '()'); |
|
800 | + throw new Exception('Call to undefined method '.get_class($this).'::'.$method.'()'); |
|
801 | 801 | } |
802 | 802 | } |
@@ -247,8 +247,8 @@ discard block |
||
247 | 247 | $split = explode('\\', $class); |
248 | 248 | $class = end($split); |
249 | 249 | |
250 | - return preg_replace_callback('/([A-Z])/', function ($matches) { |
|
251 | - return '_' . strtolower($matches[1]); |
|
250 | + return preg_replace_callback('/([A-Z])/', function($matches) { |
|
251 | + return '_'.strtolower($matches[1]); |
|
252 | 252 | }, lcfirst($class)); |
253 | 253 | } |
254 | 254 | |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | */ |
261 | 261 | protected function prepareForeignKey($class) |
262 | 262 | { |
263 | - return $this->delimitClass($class) . '_id'; |
|
263 | + return $this->delimitClass($class).'_id'; |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | /** |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | |
429 | 429 | foreach (static::arrayify($instances) as $instance) { |
430 | 430 | if (!$instance instanceof $class) { |
431 | - throw new Exception('Related models must be an instance of ' . $class); |
|
431 | + throw new Exception('Related models must be an instance of '.$class); |
|
432 | 432 | } |
433 | 433 | } |
434 | 434 | } |
@@ -578,7 +578,7 @@ discard block |
||
578 | 578 | ->filters($this->filter()) |
579 | 579 | ->orders($this->order()); |
580 | 580 | |
581 | - $builder->callback(function ($result) use ($class) { |
|
581 | + $builder->callback(function($result) use ($class) { |
|
582 | 582 | return $class::hydrate($result->data); |
583 | 583 | }); |
584 | 584 | |
@@ -788,7 +788,7 @@ discard block |
||
788 | 788 | |
789 | 789 | // Filter the IDs to associate and dissociate if any have been given |
790 | 790 | if (!empty($ids)) { |
791 | - $filter = function ($instance) use ($ids) { |
|
791 | + $filter = function($instance) use ($ids) { |
|
792 | 792 | return in_array($instance->id(), $ids); |
793 | 793 | }; |
794 | 794 | |
@@ -802,7 +802,7 @@ discard block |
||
802 | 802 | } |
803 | 803 | |
804 | 804 | // Dissociate, then associate |
805 | - if (!empty($detached)) { |
|
805 | + if (!empty($detached)) { |
|
806 | 806 | $this->dissociate($detached); |
807 | 807 | } |
808 | 808 |
@@ -23,7 +23,7 @@ |
||
23 | 23 | { |
24 | 24 | // Register the configuration service and its aliases |
25 | 25 | $container->register(array( |
26 | - Configuration::class => function (Application $application) { |
|
26 | + Configuration::class => function(Application $application) { |
|
27 | 27 | $basePath = $application->basePath(); |
28 | 28 | |
29 | 29 | // Load the application's configuration |
@@ -23,7 +23,7 @@ |
||
23 | 23 | public function register(Container $container) |
24 | 24 | { |
25 | 25 | $container->register(array( |
26 | - Connection::class => function (Container $container) { |
|
26 | + Connection::class => function(Container $container) { |
|
27 | 27 | $config = $container->config; |
28 | 28 | |
29 | 29 | $factory = new Factory; |
@@ -22,7 +22,7 @@ |
||
22 | 22 | public function register(Container $container) |
23 | 23 | { |
24 | 24 | $container->register(array( |
25 | - Router::class => function (Container $container) { |
|
25 | + Router::class => function(Container $container) { |
|
26 | 26 | /** |
27 | 27 | * @var Configuration $config |
28 | 28 | */ |