@@ -21,7 +21,7 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | public function __construct(Type $type) |
| 23 | 23 | { |
| 24 | - if (!Type::hasType($type)){ |
|
| 24 | + if (!Type::hasType($type)) { |
|
| 25 | 25 | throw new UnsupportedDataTypeException("Type '$$type' is not supported, please add it to DBAL types list (see Type::addType())"); |
| 26 | 26 | } |
| 27 | 27 | $this->type = Type::getType($type); |
@@ -41,11 +41,11 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | public function __invoke(Column $column) |
| 43 | 43 | { |
| 44 | - if ($this->depth === null){ |
|
| 44 | + if ($this->depth === null) { |
|
| 45 | 45 | $this->depth = random_int(2, 5); |
| 46 | 46 | } |
| 47 | 47 | $object = $this->generateRandomObject($this->depth); |
| 48 | - if ($this->toArray){ |
|
| 48 | + if ($this->toArray) { |
|
| 49 | 49 | $object = json_decode(json_encode($object, JSON_OBJECT_AS_ARRAY), true); |
| 50 | 50 | } |
| 51 | 51 | return $object; |
@@ -60,13 +60,13 @@ discard block |
||
| 60 | 60 | $obj = new \stdClass(); |
| 61 | 61 | $nbProps = random_int(2, 5); |
| 62 | 62 | $hasGoneDeeper = false; |
| 63 | - for ($i = 0; $i < $nbProps; $i++){ |
|
| 63 | + for ($i = 0; $i < $nbProps; $i++) { |
|
| 64 | 64 | $propName = $this->randomPropName(); |
| 65 | - $goDeeper = $depth != 0 && (random_int(0,10) > 7 || !$hasGoneDeeper); |
|
| 66 | - if ($goDeeper){ |
|
| 65 | + $goDeeper = $depth != 0 && (random_int(0, 10) > 7 || !$hasGoneDeeper); |
|
| 66 | + if ($goDeeper) { |
|
| 67 | 67 | $hasGoneDeeper = true; |
| 68 | 68 | $value = $this->generateRandomObject($depth - 1); |
| 69 | - }else{ |
|
| 69 | + }else { |
|
| 70 | 70 | $value = $this->randomValue(); |
| 71 | 71 | } |
| 72 | 72 | $obj->$propName = $value; |
@@ -25,9 +25,9 @@ |
||
| 25 | 25 | |
| 26 | 26 | public function findGenerator(Table $table, Column $column) : FakeDataGeneratorInterface |
| 27 | 27 | { |
| 28 | - foreach ($this->generators as list($condition, $generator)){ |
|
| 28 | + foreach ($this->generators as list($condition, $generator)) { |
|
| 29 | 29 | /** @var $condition ConditionInterface */ |
| 30 | - if ($condition->canApply($table, $column)){ |
|
| 30 | + if ($condition->canApply($table, $column)) { |
|
| 31 | 31 | return $generator; |
| 32 | 32 | } |
| 33 | 33 | } |