@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | // check the if the requester has the `create` |
| 111 | 111 | // permission before creating |
| 112 | - static::creating(function (ModelEvent $event) { |
|
| 112 | + static::creating(function(ModelEvent $event) { |
|
| 113 | 113 | $model = $event->getModel(); |
| 114 | 114 | |
| 115 | 115 | if (!$model->can('create', ACLModel::getRequester())) { |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | // check the if the requester has the `edit` |
| 123 | 123 | // permission before updating |
| 124 | - static::updating(function (ModelEvent $event) { |
|
| 124 | + static::updating(function(ModelEvent $event) { |
|
| 125 | 125 | $model = $event->getModel(); |
| 126 | 126 | |
| 127 | 127 | if (!$model->can('edit', ACLModel::getRequester())) { |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | |
| 134 | 134 | // check the if the requester has the `delete` |
| 135 | 135 | // permission before deleting |
| 136 | - static::deleting(function (ModelEvent $event) { |
|
| 136 | + static::deleting(function(ModelEvent $event) { |
|
| 137 | 137 | $model = $event->getModel(); |
| 138 | 138 | |
| 139 | 139 | if (!$model->can('delete', ACLModel::getRequester())) { |
@@ -157,7 +157,7 @@ |
||
| 157 | 157 | |
| 158 | 158 | // cache the local properties |
| 159 | 159 | $this->getCacheItem() |
| 160 | - ->set($this->_values, $this->getCacheTTL()); |
|
| 160 | + ->set($this->_values, $this->getCacheTTL()); |
|
| 161 | 161 | |
| 162 | 162 | return $this; |
| 163 | 163 | } |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | /** |
| 53 | 53 | * Gets the model instance for these errors. |
| 54 | 54 | * |
| 55 | - * @return Model|string|null |
|
| 55 | + * @return Model |
|
| 56 | 56 | */ |
| 57 | 57 | public function getModel() |
| 58 | 58 | { |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | * @param string $error |
| 151 | 151 | * @param string|false $locale |
| 152 | 152 | * |
| 153 | - * @return array |
|
| 153 | + * @return string |
|
| 154 | 154 | */ |
| 155 | 155 | private function parse($property, $error, $locale) |
| 156 | 156 | { |
@@ -120,7 +120,6 @@ discard block |
||
| 120 | 120 | * of parameters to be specified. This example would generate |
| 121 | 121 | * [['numeric', []], ['range', [10, 30]]]. |
| 122 | 122 | * |
| 123 | - * @param string $rules |
|
| 124 | 123 | * |
| 125 | 124 | * @return array |
| 126 | 125 | */ |
@@ -254,7 +253,6 @@ discard block |
||
| 254 | 253 | /** |
| 255 | 254 | * Validates an e-mail address. |
| 256 | 255 | * |
| 257 | - * @param string $email e-mail address |
|
| 258 | 256 | * @param array $parameters parameters for validation |
| 259 | 257 | * |
| 260 | 258 | * @return bool success |
@@ -284,7 +282,7 @@ discard block |
||
| 284 | 282 | * |
| 285 | 283 | * @param mixed $value |
| 286 | 284 | * |
| 287 | - * @return bool |
|
| 285 | + * @return integer |
|
| 288 | 286 | */ |
| 289 | 287 | private function date($value) |
| 290 | 288 | { |
@@ -519,7 +517,6 @@ discard block |
||
| 519 | 517 | * @param mixed $value |
| 520 | 518 | * @param array $parameters |
| 521 | 519 | * @param string $name |
| 522 | - * @param Model $model |
|
| 523 | 520 | * |
| 524 | 521 | * @return bool |
| 525 | 522 | */ |
@@ -180,13 +180,13 @@ |
||
| 180 | 180 | static::$casts['updated_at'] = self::TYPE_DATE; |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - self::creating(function (ModelEvent $event) { |
|
| 183 | + self::creating(function(ModelEvent $event) { |
|
| 184 | 184 | $model = $event->getModel(); |
| 185 | 185 | $model->created_at = time(); |
| 186 | 186 | $model->updated_at = time(); |
| 187 | 187 | }); |
| 188 | 188 | |
| 189 | - self::updating(function (ModelEvent $event) { |
|
| 189 | + self::updating(function(ModelEvent $event) { |
|
| 190 | 190 | $event->getModel()->updated_at = time(); |
| 191 | 191 | }); |
| 192 | 192 | } |
@@ -546,46 +546,46 @@ |
||
| 546 | 546 | } |
| 547 | 547 | |
| 548 | 548 | switch ($type) { |
| 549 | - case self::TYPE_STRING: |
|
| 550 | - return (string) $value; |
|
| 549 | + case self::TYPE_STRING: |
|
| 550 | + return (string) $value; |
|
| 551 | 551 | |
| 552 | - case self::TYPE_INTEGER: |
|
| 553 | - return (int) $value; |
|
| 552 | + case self::TYPE_INTEGER: |
|
| 553 | + return (int) $value; |
|
| 554 | 554 | |
| 555 | - case self::TYPE_FLOAT: |
|
| 556 | - return (float) $value; |
|
| 555 | + case self::TYPE_FLOAT: |
|
| 556 | + return (float) $value; |
|
| 557 | 557 | |
| 558 | - case self::TYPE_BOOLEAN: |
|
| 559 | - return filter_var($value, FILTER_VALIDATE_BOOLEAN); |
|
| 558 | + case self::TYPE_BOOLEAN: |
|
| 559 | + return filter_var($value, FILTER_VALIDATE_BOOLEAN); |
|
| 560 | 560 | |
| 561 | - case self::TYPE_DATE: |
|
| 562 | - // cast dates into Carbon objects |
|
| 563 | - if ($value instanceof Carbon) { |
|
| 564 | - return $value; |
|
| 565 | - } else { |
|
| 566 | - $format = self::getDateFormat($property); |
|
| 561 | + case self::TYPE_DATE: |
|
| 562 | + // cast dates into Carbon objects |
|
| 563 | + if ($value instanceof Carbon) { |
|
| 564 | + return $value; |
|
| 565 | + } else { |
|
| 566 | + $format = self::getDateFormat($property); |
|
| 567 | 567 | |
| 568 | - return Carbon::createFromFormat($format, $value); |
|
| 569 | - } |
|
| 568 | + return Carbon::createFromFormat($format, $value); |
|
| 569 | + } |
|
| 570 | 570 | |
| 571 | - case self::TYPE_ARRAY: |
|
| 572 | - // decode JSON into an array |
|
| 573 | - if (is_string($value)) { |
|
| 574 | - return json_decode($value, true); |
|
| 575 | - } else { |
|
| 576 | - return (array) $value; |
|
| 577 | - } |
|
| 571 | + case self::TYPE_ARRAY: |
|
| 572 | + // decode JSON into an array |
|
| 573 | + if (is_string($value)) { |
|
| 574 | + return json_decode($value, true); |
|
| 575 | + } else { |
|
| 576 | + return (array) $value; |
|
| 577 | + } |
|
| 578 | 578 | |
| 579 | - case self::TYPE_OBJECT: |
|
| 580 | - // decode JSON into an object |
|
| 581 | - if (is_string($value)) { |
|
| 582 | - return (object) json_decode($value); |
|
| 583 | - } else { |
|
| 584 | - return (object) $value; |
|
| 585 | - } |
|
| 579 | + case self::TYPE_OBJECT: |
|
| 580 | + // decode JSON into an object |
|
| 581 | + if (is_string($value)) { |
|
| 582 | + return (object) json_decode($value); |
|
| 583 | + } else { |
|
| 584 | + return (object) $value; |
|
| 585 | + } |
|
| 586 | 586 | |
| 587 | - default: |
|
| 588 | - return $value; |
|
| 587 | + default: |
|
| 588 | + return $value; |
|
| 589 | 589 | } |
| 590 | 590 | } |
| 591 | 591 | |
@@ -199,6 +199,7 @@ discard block |
||
| 199 | 199 | * |
| 200 | 200 | * @param Model|string model class |
| 201 | 201 | * @param array $values |
| 202 | + * @param Model $model |
|
| 202 | 203 | * |
| 203 | 204 | * @return array |
| 204 | 205 | */ |
@@ -232,7 +233,6 @@ discard block |
||
| 232 | 233 | /** |
| 233 | 234 | * Returns a prefixed where statement. |
| 234 | 235 | * |
| 235 | - * @param string $columns |
|
| 236 | 236 | * @param string $tablename |
| 237 | 237 | * |
| 238 | 238 | * @return string |
@@ -260,7 +260,6 @@ discard block |
||
| 260 | 260 | /** |
| 261 | 261 | * Returns a prefixed sort statement. |
| 262 | 262 | * |
| 263 | - * @param string $columns |
|
| 264 | 263 | * @param string $tablename |
| 265 | 264 | * |
| 266 | 265 | * @return string |