@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $name = $this->relation->getName(); |
| 55 | 55 | $foreignMapper = $mapper->getOrm()->getMapper($this->relation->getForeignMapper()); |
| 56 | 56 | $type = $foreignMapper->getEntityNamespace() |
| 57 | - . '\\' . $foreignMapper->getEntityClass(); |
|
| 57 | + . '\\' . $foreignMapper->getEntityClass(); |
|
| 58 | 58 | |
| 59 | 59 | $class->getNamespace()->addUse(Collection::class); |
| 60 | 60 | $class->getNamespace()->addUse($type, null, $type); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $setter = $class->addMethod(Str::methodName($name, 'set')); |
| 66 | 66 | $setter->setVisibility(ClassType::VISIBILITY_PUBLIC); |
| 67 | 67 | $setter->addParameter('value') |
| 68 | - ->setType('Collection'); |
|
| 68 | + ->setType('Collection'); |
|
| 69 | 69 | $setter->setBody('$this->set(\'' . $name . '\', $value);'); |
| 70 | 70 | |
| 71 | 71 | $getter = $class->addMethod(Str::methodName($name, 'get')); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | $adder = $class->addMethod(Str::methodName($singular, 'add')); |
| 80 | 80 | $adder->setVisibility(ClassType::VISIBILITY_PUBLIC); |
| 81 | 81 | $adder->addParameter($singular) |
| 82 | - ->setType($type); |
|
| 82 | + ->setType($type); |
|
| 83 | 83 | $adder->setBody(sprintf('$this->get(\'%s\')->add($%s);', $name, $singular)); |
| 84 | 84 | |
| 85 | 85 | $class = $this->addAggregates($class); |
@@ -104,7 +104,7 @@ |
||
| 104 | 104 | |
| 105 | 105 | private function addAggregates(ClassType $class) |
| 106 | 106 | { |
| 107 | - $mapper = $this->relation->getMapper(); |
|
| 107 | + $mapper = $this->relation->getMapper(); |
|
| 108 | 108 | $aggregates = $this->relation->getAggregates(); |
| 109 | 109 | |
| 110 | 110 | foreach ($aggregates as $name => $aggregate) { |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | { |
| 64 | 64 | $this->relations[$name] = $relation; |
| 65 | 65 | $this->relationCallback[$name] = $callback; |
| 66 | - if ( ! empty($nextLoad)) { |
|
| 66 | + if (!empty($nextLoad)) { |
|
| 67 | 67 | $this->relationNextLoad[$name] = $nextLoad; |
| 68 | 68 | } |
| 69 | 69 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | |
| 76 | 76 | public function getResultsForRelation($name) |
| 77 | 77 | { |
| 78 | - if ( ! isset($this->relations[$name])) { |
|
| 78 | + if (!isset($this->relations[$name])) { |
|
| 79 | 79 | return []; |
| 80 | 80 | } |
| 81 | 81 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | $result = []; |
| 113 | 113 | foreach ($this->rows as $row) { |
| 114 | 114 | $value = $this->getColumnsFromRow($row, $columns, $hydrator); |
| 115 | - if ($value && ! in_array($value, $result)) { |
|
| 115 | + if ($value && !in_array($value, $result)) { |
|
| 116 | 116 | $result[] = $value; |
| 117 | 117 | } |
| 118 | 118 | } |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | public function getLazyAggregate(Aggregate $aggregate) |
| 144 | 144 | { |
| 145 | 145 | $name = $aggregate->getName(); |
| 146 | - if ( ! isset($this->lazyAggregates[$name])) { |
|
| 146 | + if (!isset($this->lazyAggregates[$name])) { |
|
| 147 | 147 | $this->lazyAggregates[$name] = new LazyAggregate($this, $aggregate); |
| 148 | 148 | } |
| 149 | 149 | |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | public function getLazyRelation(Relation $relation) |
| 154 | 154 | { |
| 155 | 155 | $name = $relation->getOption('name'); |
| 156 | - if ( ! isset($this->lazyRelations[$name])) { |
|
| 156 | + if (!isset($this->lazyRelations[$name])) { |
|
| 157 | 157 | $this->lazyRelations[$name] = new LazyRelation($this, $relation); |
| 158 | 158 | } |
| 159 | 159 | |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | $queryNextLoad = $this->relationNextLoad[$name] ?? []; |
| 192 | - if ($queryNextLoad && ! empty($queryNextLoad)) { |
|
| 192 | + if ($queryNextLoad && !empty($queryNextLoad)) { |
|
| 193 | 193 | foreach ($queryNextLoad as $next => $callback) { |
| 194 | 194 | $query = $query->load([$next => $callback]); |
| 195 | 195 | } |
@@ -38,13 +38,13 @@ |
||
| 38 | 38 | * For example, on one-to-many relations when persisting the "parent", |
| 39 | 39 | * the actions that persist the "children" have to know about the parent's ID |
| 40 | 40 | */ |
| 41 | - $this->entityHydrator->setPk($this->entity, (int) $connection->lastInsertId()); |
|
| 41 | + $this->entityHydrator->setPk($this->entity, (int)$connection->lastInsertId()); |
|
| 42 | 42 | $this->entity->setState(StateEnum::SYNCHRONIZED); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | public function revert() |
| 46 | 46 | { |
| 47 | - if ( ! $this->hasRun) { |
|
| 47 | + if (!$this->hasRun) { |
|
| 48 | 48 | return; |
| 49 | 49 | } |
| 50 | 50 | $this->entityHydrator->setPk($this->entity, $this->entityId); |