@@ -44,14 +44,14 @@ |
||
| 44 | 44 | if (!is_bool($value)) { |
| 45 | 45 | // convert int to string |
| 46 | 46 | if (is_int($value)) { |
| 47 | - $value = (string)$value; |
|
| 47 | + $value = (string) $value; |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | if (!is_string($value) || |
| 51 | 51 | ($value !== $this->getBoolean(true) && $value !== $this->getBoolean(false)) |
| 52 | 52 | ) { |
| 53 | 53 | // value is not boolean, not int and (not string OR string value for boolean) |
| 54 | - return new NoBoolean([ 'value' => (string)$value ]); |
|
| 54 | + return new NoBoolean(['value' => (string) $value]); |
|
| 55 | 55 | } |
| 56 | 56 | } |
| 57 | 57 | |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | public function validate($value) |
| 17 | 17 | { |
| 18 | 18 | if (!is_int($value) && !is_double($value) && (!is_string($value) || !is_numeric($value))) { |
| 19 | - return new NoNumber([ 'value' => (string)$value ]); |
|
| 19 | + return new NoNumber(['value' => (string) $value]); |
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | return true; |
@@ -148,8 +148,8 @@ |
||
| 148 | 148 | /** |
| 149 | 149 | * Get the column name with $namingScheme or default naming scheme |
| 150 | 150 | * |
| 151 | - * @param $name |
|
| 152 | - * @param null $namingScheme |
|
| 151 | + * @param string $name |
|
| 152 | + * @param string $namingScheme |
|
| 153 | 153 | * @return string |
| 154 | 154 | */ |
| 155 | 155 | public function getMethodName($name, $namingScheme = null) |
@@ -273,7 +273,7 @@ discard block |
||
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | if (is_scalar($values[$attribute]) || is_null($values[$attribute])) { |
| 276 | - return (string)$values[$attribute]; |
|
| 276 | + return (string) $values[$attribute]; |
|
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | // otherwise we assume it is an array |
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | |
| 282 | 282 | if (isset($arrayAccessor[0])) { |
| 283 | 283 | $from = $arrayAccessor[0] === '-' ? |
| 284 | - count($array) - abs($arrayAccessor) : (int)$arrayAccessor; |
|
| 284 | + count($array) - abs($arrayAccessor) : (int) $arrayAccessor; |
|
| 285 | 285 | |
| 286 | 286 | if ($from >= count($array)) { |
| 287 | 287 | return ''; |
@@ -575,7 +575,7 @@ |
||
| 575 | 575 | if (!empty($attribute)) { |
| 576 | 576 | $col = static::getColumnName($attribute); |
| 577 | 577 | return (isset($this->data[$col]) ? $this->data[$col] : null) !== |
| 578 | - (isset($this->originalData[$col]) ? $this->originalData[$col] : null); |
|
| 578 | + (isset($this->originalData[$col]) ? $this->originalData[$col] : null); |
|
| 579 | 579 | } |
| 580 | 580 | |
| 581 | 581 | ksort($this->data); |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | if (!is_string($value)) { |
| 27 | 27 | return new NoString(['type' => 'json']); |
| 28 | 28 | } elseif ($value !== 'null' && json_decode($value) === null) { |
| 29 | - return new InvalidJson([ 'value' => (string)$value ]); |
|
| 29 | + return new InvalidJson(['value' => (string) $value]); |
|
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | return true; |