@@ -391,7 +391,7 @@ |
||
391 | 391 | */ |
392 | 392 | public function setMany($values) |
393 | 393 | { |
394 | - foreach ((array) $values as $attribute => $value){ |
|
394 | + foreach ((array) $values as $attribute => $value) { |
|
395 | 395 | $this->set($attribute, $value); |
396 | 396 | } |
397 | 397 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | protected static function concatenate($strings, $delimiter = ' ') |
47 | 47 | { |
48 | - $strings = array_filter($strings, function ($value) { |
|
48 | + $strings = array_filter($strings, function($value) { |
|
49 | 49 | return !empty($value); |
50 | 50 | }); |
51 | 51 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | { |
79 | 79 | $type = $storageQuery->type; |
80 | 80 | |
81 | - $method = 'translate' . ucfirst($type); |
|
81 | + $method = 'translate'.ucfirst($type); |
|
82 | 82 | |
83 | 83 | if (!method_exists($this, $method)) { |
84 | 84 | throw new InvalidArgumentException("Could not translate query of unknown type '$type'"); |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | protected function translateTranslatable($query) |
249 | 249 | { |
250 | 250 | if (!$this->translatable($query)) { |
251 | - throw new InvalidArgumentException("Cannot translate query of type '" . get_class($query) . "'"); |
|
251 | + throw new InvalidArgumentException("Cannot translate query of type '".get_class($query)."'"); |
|
252 | 252 | } |
253 | 253 | |
254 | 254 | if ($query instanceof Storage\Query\Builder) { |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | return $this->translate($query); |
260 | 260 | } |
261 | 261 | |
262 | - throw new InvalidArgumentException("Cannot translate query of type '" . get_class($query) . "'"); |
|
262 | + throw new InvalidArgumentException("Cannot translate query of type '".get_class($query)."'"); |
|
263 | 263 | } |
264 | 264 | |
265 | 265 | /** |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | protected function prepareJoinType($type) |
443 | 443 | { |
444 | 444 | if (in_array($type, array('left', 'right'))) { |
445 | - return strtoupper($type) . ' JOIN'; |
|
445 | + return strtoupper($type).' JOIN'; |
|
446 | 446 | } |
447 | 447 | |
448 | 448 | return 'JOIN'; |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | } |
574 | 574 | |
575 | 575 | if (is_array($value)) { |
576 | - $value = "(" . implode(", ", $value) . ")"; |
|
576 | + $value = "(".implode(", ", $value).")"; |
|
577 | 577 | } |
578 | 578 | |
579 | 579 | return "$column $operator $value"; |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | |
594 | 594 | foreach ($filter as $column => $value) { |
595 | 595 | if (strtolower($column) == 'or') { |
596 | - $conditions[] = '(' . $this->prepareWhere($value, 'OR', true) . ')'; |
|
596 | + $conditions[] = '('.$this->prepareWhere($value, 'OR', true).')'; |
|
597 | 597 | } else { |
598 | 598 | $conditions[] = $this->prepareFilterCondition($column, $value); |
599 | 599 | } |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | } |
673 | 673 | } |
674 | 674 | |
675 | - return count($conditions) ? 'ORDER BY ' . implode(', ', $conditions) : null; |
|
675 | + return count($conditions) ? 'ORDER BY '.implode(', ', $conditions) : null; |
|
676 | 676 | } |
677 | 677 | |
678 | 678 | /** |
@@ -692,7 +692,7 @@ discard block |
||
692 | 692 | */ |
693 | 693 | protected function prepareGroupBy(array $groupings) |
694 | 694 | { |
695 | - return count($groupings) ? 'GROUP BY ' . implode(', ', $this->identifier($groupings)) : null; |
|
695 | + return count($groupings) ? 'GROUP BY '.implode(', ', $this->identifier($groupings)) : null; |
|
696 | 696 | } |
697 | 697 | |
698 | 698 | /** |
@@ -757,8 +757,8 @@ discard block |
||
757 | 757 | $columns = $this->identifier(array_keys($data)); |
758 | 758 | $values = $this->value(array_values($data)); |
759 | 759 | |
760 | - $columns = '(' . implode(', ', $columns) . ')'; |
|
761 | - $values = '(' . implode(', ', $values) . ')'; |
|
760 | + $columns = '('.implode(', ', $columns).')'; |
|
761 | + $values = '('.implode(', ', $values).')'; |
|
762 | 762 | |
763 | 763 | return static::concatenate(array('INSERT INTO', $table, $columns, 'VALUES', $values)); |
764 | 764 | } |
@@ -778,7 +778,7 @@ discard block |
||
778 | 778 | |
779 | 779 | if (!empty($columns)) { |
780 | 780 | $columns = $this->identifier($columns); |
781 | - $columns = "(" . implode(", ", $columns) . ")"; |
|
781 | + $columns = "(".implode(", ", $columns).")"; |
|
782 | 782 | } |
783 | 783 | |
784 | 784 | $subquery = (string) $this->translate($subquery); |
@@ -53,7 +53,7 @@ |
||
53 | 53 | $query .= "$offset, "; |
54 | 54 | } |
55 | 55 | |
56 | - return $query . $limit; |
|
56 | + return $query.$limit; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -20,7 +20,7 @@ |
||
20 | 20 | public function register(Container $container) |
21 | 21 | { |
22 | 22 | $container->register(array( |
23 | - 'Darya\Smarty\ViewResolver' => function ($container) { |
|
23 | + 'Darya\Smarty\ViewResolver' => function($container) { |
|
24 | 24 | $basePath = $container->get('path'); |
25 | 25 | $realBasePath = realpath("{$basePath}/views/smarty"); |
26 | 26 |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | { |
127 | 127 | $filterer = $this; |
128 | 128 | |
129 | - return function ($row) use ($filterer, $filter, $or) { |
|
129 | + return function($row) use ($filterer, $filter, $or) { |
|
130 | 130 | return $filterer->matches($row, $filter, $or); |
131 | 131 | }; |
132 | 132 | } |
@@ -480,7 +480,7 @@ discard block |
||
480 | 480 | { |
481 | 481 | $value = preg_quote($value, '/'); |
482 | 482 | |
483 | - $pattern = '/' . preg_replace(array('/([^\\\])?_/', '/([^\\\])?%/'), array('$1.', '$1.*'), $value) . '/i'; |
|
483 | + $pattern = '/'.preg_replace(array('/([^\\\])?_/', '/([^\\\])?%/'), array('$1.', '$1.*'), $value).'/i'; |
|
484 | 484 | |
485 | 485 | return preg_match($pattern, $actual); |
486 | 486 | } |
@@ -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 | } |