@@ -18,12 +18,12 @@ |
||
| 18 | 18 | public function validate($value) |
| 19 | 19 | { |
| 20 | 20 | if (!is_string($value)) { |
| 21 | - return new NoString([ 'type' => 'set' ]); |
|
| 21 | + return new NoString(['type' => 'set']); |
|
| 22 | 22 | } else { |
| 23 | 23 | $values = explode(',', $value); |
| 24 | 24 | foreach ($values as $value) { |
| 25 | 25 | if (!in_array($value, $this->allowedValues)) { |
| 26 | - return new NotAllowed([ 'value' => $value, 'type' => 'set' ]); |
|
| 26 | + return new NotAllowed(['value' => $value, 'type' => 'set']); |
|
| 27 | 27 | } |
| 28 | 28 | } |
| 29 | 29 | } |
@@ -41,9 +41,9 @@ |
||
| 41 | 41 | public function validate($value) |
| 42 | 42 | { |
| 43 | 43 | if (!is_string($value)) { |
| 44 | - return new NoString([ 'type' => 'enum' ]); |
|
| 44 | + return new NoString(['type' => 'enum']); |
|
| 45 | 45 | } elseif (!in_array($value, $this->allowedValues)) { |
| 46 | - return new NotAllowed([ 'value' => $value, 'type' => 'enum' ]); |
|
| 46 | + return new NotAllowed(['value' => $value, 'type' => 'enum']); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | return true; |
@@ -63,8 +63,8 @@ discard block |
||
| 63 | 63 | |
| 64 | 64 | $this->tableName = $entityManager->escapeIdentifier($class::getTableName()); |
| 65 | 65 | $this->alias = 't0'; |
| 66 | - $this->columns = [ 't0.*' ]; |
|
| 67 | - $this->modifier = [ 'DISTINCT' ]; |
|
| 66 | + $this->columns = ['t0.*']; |
|
| 67 | + $this->modifier = ['DISTINCT']; |
|
| 68 | 68 | |
| 69 | 69 | $this->classMapping['byClass'][$class] = 't0'; |
| 70 | 70 | $this->classMapping['byAlias']['t0'] = $class; |
@@ -191,7 +191,7 @@ discard block |
||
| 191 | 191 | $alias = $this->alias; |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | - call_user_func([ $class, 'getRelation' ], $relation)->addJoin($this, $join, $alias); |
|
| 194 | + call_user_func([$class, 'getRelation'], $relation)->addJoin($this, $join, $alias); |
|
| 195 | 195 | return $this; |
| 196 | 196 | } |
| 197 | 197 | |
@@ -289,11 +289,11 @@ discard block |
||
| 289 | 289 | public function count() |
| 290 | 290 | { |
| 291 | 291 | // set the columns and reset after get query |
| 292 | - $this->columns = [ 'COUNT(DISTINCT t0.*)' ]; |
|
| 292 | + $this->columns = ['COUNT(DISTINCT t0.*)']; |
|
| 293 | 293 | $this->modifier = []; |
| 294 | 294 | $query = $this->getQuery(); |
| 295 | - $this->columns = [ 't0.*' ]; |
|
| 296 | - $this->modifier = [ 'DISTINCT' ]; |
|
| 295 | + $this->columns = ['t0.*']; |
|
| 296 | + $this->modifier = ['DISTINCT']; |
|
| 297 | 297 | |
| 298 | 298 | return (int) $this->entityManager->getConnection()->query($query)->fetchColumn(); |
| 299 | 299 | } |
@@ -305,7 +305,7 @@ |
||
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | $array = substr($accessor, -1) === '*' ? |
| 308 | - array_slice($array, $from) : [ $array[$from] ]; |
|
| 308 | + array_slice($array, $from) : [$array[$from]]; |
|
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | return implode($glue, $array); |
@@ -19,6 +19,6 @@ |
||
| 19 | 19 | |
| 20 | 20 | public function __construct(Column $column) |
| 21 | 21 | { |
| 22 | - parent::__construct([ 'column' => $column->name ]); |
|
| 22 | + parent::__construct(['column' => $column->name]); |
|
| 23 | 23 | } |
| 24 | 24 | } |
@@ -24,9 +24,9 @@ |
||
| 24 | 24 | public function validate($value) |
| 25 | 25 | { |
| 26 | 26 | if (!is_string($value)) { |
| 27 | - return new NoString([ 'type' => 'json' ]); |
|
| 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; |
@@ -48,9 +48,9 @@ |
||
| 48 | 48 | public function validate($value) |
| 49 | 49 | { |
| 50 | 50 | if (!is_string($value)) { |
| 51 | - return new NoString([ 'type' => $this->type ]); |
|
| 51 | + return new NoString(['type' => $this->type]); |
|
| 52 | 52 | } elseif ($this->maxLength !== 0 && mb_strlen($value) > $this->maxLength) { |
| 53 | - return new TooLong([ 'value' => $value, 'max' => $this->maxLength ]); |
|
| 53 | + return new TooLong(['value' => $value, 'max' => $this->maxLength]); |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | return true; |
@@ -51,7 +51,7 @@ |
||
| 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 | |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | public function validate($value) |
| 24 | 24 | { |
| 25 | 25 | if (!is_int($value) && !is_double($value) && (!is_string($value) || !is_numeric($value))) { |
| 26 | - return new NoNumber([ 'value' => (string) $value ]); |
|
| 26 | + return new NoNumber(['value' => (string) $value]); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | return true; |