@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | */ |
| 41 | 41 | public function setItems($items) |
| 42 | 42 | { |
| 43 | - if (! is_array($items)) { |
|
| 43 | + if (!is_array($items)) { |
|
| 44 | 44 | $items = func_get_args(); |
| 45 | 45 | } |
| 46 | 46 | |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | */ |
| 69 | 69 | public function addHeader($items) |
| 70 | 70 | { |
| 71 | - if (! is_array($items)) { |
|
| 71 | + if (!is_array($items)) { |
|
| 72 | 72 | $items = func_get_args(); |
| 73 | 73 | } |
| 74 | 74 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | */ |
| 85 | 85 | public function addBody($items) |
| 86 | 86 | { |
| 87 | - if (! is_array($items)) { |
|
| 87 | + if (!is_array($items)) { |
|
| 88 | 88 | $items = func_get_args(); |
| 89 | 89 | } |
| 90 | 90 | |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | public function addFooter($items) |
| 106 | 106 | { |
| 107 | - if (! is_array($items)) { |
|
| 107 | + if (!is_array($items)) { |
|
| 108 | 108 | $items = func_get_args(); |
| 109 | 109 | } |
| 110 | 110 | |
@@ -14,14 +14,14 @@ discard block |
||
| 14 | 14 | /** |
| 15 | 15 | * @var array |
| 16 | 16 | */ |
| 17 | - protected $data = []; |
|
| 17 | + protected $data = [ ]; |
|
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * @param string $view |
| 21 | 21 | * @param array $data |
| 22 | 22 | * @param Closure $callback |
| 23 | 23 | */ |
| 24 | - public function __construct($view, array $data = [], Closure $callback = null) |
|
| 24 | + public function __construct($view, array $data = [ ], Closure $callback = null) |
|
| 25 | 25 | { |
| 26 | 26 | $this->setView($view); |
| 27 | 27 | $this->setData($data); |
@@ -46,8 +46,8 @@ discard block |
||
| 46 | 46 | { |
| 47 | 47 | $this->view = $view; |
| 48 | 48 | |
| 49 | - $this->setDisplay(function ($model) { |
|
| 50 | - $this->data['model'] = $model; |
|
| 49 | + $this->setDisplay(function($model) { |
|
| 50 | + $this->data[ 'model' ] = $model; |
|
| 51 | 51 | |
| 52 | 52 | return view($this->getView(), $this->data); |
| 53 | 53 | }); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | ]; |
| 92 | 92 | |
| 93 | 93 | if ($this->isTaggable()) { |
| 94 | - $attributes['class'] .= ' input-taggable'; |
|
| 94 | + $attributes[ 'class' ] .= ' input-taggable'; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | return [ |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | $attribute = $this->getAttribute(); |
| 117 | 117 | |
| 118 | 118 | if (is_null(Request::input($this->getPath()))) { |
| 119 | - $values = []; |
|
| 119 | + $values = [ ]; |
|
| 120 | 120 | } else { |
| 121 | 121 | $values = $this->getValue(); |
| 122 | 122 | } |
@@ -125,19 +125,19 @@ discard block |
||
| 125 | 125 | |
| 126 | 126 | if ($relation instanceof \Illuminate\Database\Eloquent\Relations\BelongsToMany) { |
| 127 | 127 | foreach ($values as $i => $value) { |
| 128 | - if (! array_key_exists($value, $this->getOptions()) and $this->isTaggable()) { |
|
| 128 | + if (!array_key_exists($value, $this->getOptions()) and $this->isTaggable()) { |
|
| 129 | 129 | $model = clone $this->getModelForOptions(); |
| 130 | 130 | $model->{$this->getDisplay()} = $value; |
| 131 | 131 | $model->save(); |
| 132 | 132 | |
| 133 | - $values[$i] = $model->getKey(); |
|
| 133 | + $values[ $i ] = $model->getKey(); |
|
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | $relation->sync($values); |
| 138 | 138 | } elseif ($relation instanceof \Illuminate\Database\Eloquent\Relations\HasMany) { |
| 139 | 139 | foreach ($relation->get() as $item) { |
| 140 | - if (! in_array($item->getKey(), $values)) { |
|
| 140 | + if (!in_array($item->getKey(), $values)) { |
|
| 141 | 141 | if ($this->isDeleteRelatedItem()) { |
| 142 | 142 | $item->delete(); |
| 143 | 143 | } else { |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | $item = $model->find($value); |
| 154 | 154 | |
| 155 | 155 | if (is_null($item)) { |
| 156 | - if (! $this->isTaggable()) { |
|
| 156 | + if (!$this->isTaggable()) { |
|
| 157 | 157 | continue; |
| 158 | 158 | } |
| 159 | 159 | |
@@ -9,8 +9,8 @@ |
||
| 9 | 9 | public function save() |
| 10 | 10 | { |
| 11 | 11 | $name = $this->getName(); |
| 12 | - if (! Request::has($name)) { |
|
| 13 | - Request::merge([$name => 0]); |
|
| 12 | + if (!Request::has($name)) { |
|
| 13 | + Request::merge([ $name => 0 ]); |
|
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | parent::save(); |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | { |
| 14 | 14 | $value = $this->getValue(); |
| 15 | 15 | |
| 16 | - if (! $this->isAllowedEmptyValue() and $this->getModel()->exists() and empty($value)) { |
|
| 16 | + if (!$this->isAllowedEmptyValue() and $this->getModel()->exists() and empty($value)) { |
|
| 17 | 17 | return; |
| 18 | 18 | } |
| 19 | 19 | |
@@ -27,11 +27,11 @@ discard block |
||
| 27 | 27 | { |
| 28 | 28 | $data = parent::getValidationRules(); |
| 29 | 29 | |
| 30 | - if (! $this->isAllowedEmptyValue() and $this->getModel()->exists()) { |
|
| 30 | + if (!$this->isAllowedEmptyValue() and $this->getModel()->exists()) { |
|
| 31 | 31 | foreach ($data as $field => $rules) { |
| 32 | 32 | foreach ($rules as $i => $rule) { |
| 33 | 33 | if ($rule == 'required') { |
| 34 | - unset($data[$field][$i]); |
|
| 34 | + unset($data[ $field ][ $i ]); |
|
| 35 | 35 | } |
| 36 | 36 | } |
| 37 | 37 | } |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | /** |
| 20 | 20 | * @var array |
| 21 | 21 | */ |
| 22 | - protected $parameters = []; |
|
| 22 | + protected $parameters = [ ]; |
|
| 23 | 23 | |
| 24 | 24 | /** |
| 25 | 25 | * @var bool |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | */ |
| 89 | 89 | public function setHeight($height) |
| 90 | 90 | { |
| 91 | - $this->parameters['height'] = (int) $height; |
|
| 91 | + $this->parameters[ 'height' ] = (int) $height; |
|
| 92 | 92 | |
| 93 | 93 | return $this; |
| 94 | 94 | } |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | $filteredValue = $value; |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | - if (! empty($this->filteredFieldKey)) { |
|
| 155 | + if (!empty($this->filteredFieldKey)) { |
|
| 156 | 156 | parent::setValue($model, $attribute, $value); |
| 157 | 157 | parent::setValue($model, $this->filteredFieldKey, $filteredValue); |
| 158 | 158 | } else { |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | public function __construct(Closure $callback = null) |
| 26 | 26 | { |
| 27 | - if (! is_null($callback)) { |
|
| 27 | + if (!is_null($callback)) { |
|
| 28 | 28 | $this->setCallback($callback); |
| 29 | 29 | } |
| 30 | 30 | |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | |
| 32 | 32 | if (Request::input($this->getPath().'_remove')) { |
| 33 | 33 | $this->setValue($this->getModel(), $this->getAttribute(), null); |
| 34 | - } elseif (! is_null($value)) { |
|
| 34 | + } elseif (!is_null($value)) { |
|
| 35 | 35 | $this->setValue($this->getModel(), $this->getAttribute(), $value); |
| 36 | 36 | } |
| 37 | 37 | } |
@@ -11,13 +11,13 @@ discard block |
||
| 11 | 11 | $name = $this->getName(); |
| 12 | 12 | $value = Request::input($name, ''); |
| 13 | 13 | |
| 14 | - if (! empty($value)) { |
|
| 14 | + if (!empty($value)) { |
|
| 15 | 15 | $value = explode(',', $value); |
| 16 | 16 | } else { |
| 17 | - $value = []; |
|
| 17 | + $value = [ ]; |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | - Request::merge([$name => $value]); |
|
| 20 | + Request::merge([ $name => $value ]); |
|
| 21 | 21 | parent::save(); |
| 22 | 22 | } |
| 23 | 23 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | { |
| 29 | 29 | $value = parent::getValue(); |
| 30 | 30 | if (is_null($value)) { |
| 31 | - $value = []; |
|
| 31 | + $value = [ ]; |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | if (is_string($value)) { |