| @@ -33,7 +33,7 @@ discard block | ||
| 33 | 33 | */ | 
| 34 | 34 | public function add(Table $table): self | 
| 35 | 35 |      { | 
| 36 | -        if($this->mainTable === null) { | |
| 36 | +        if ($this->mainTable === null) { | |
| 37 | 37 | $this->mainTable = $table; | 
| 38 | 38 | } | 
| 39 | 39 | |
| @@ -49,7 +49,7 @@ discard block | ||
| 49 | 49 | */ | 
| 50 | 50 | public function getMainTable(): Table | 
| 51 | 51 |      { | 
| 52 | -        if($this->mainTable === null) { | |
| 52 | +        if ($this->mainTable === null) { | |
| 53 | 53 |              throw new QueryRelationManagerException('no main table found in TableManager'); | 
| 54 | 54 | } | 
| 55 | 55 | |
| @@ -79,10 +79,10 @@ discard block | ||
| 79 | 79 | $tableAliasChain = $this->getTableAliasChain($tableAlias, $joinConditions); | 
| 80 | 80 | $result = []; | 
| 81 | 81 | |
| 82 | -        foreach($tableAliasChain as $alias) { | |
| 82 | +        foreach ($tableAliasChain as $alias) { | |
| 83 | 83 | $table = $this->byAlias($alias); | 
| 84 | 84 | |
| 85 | -            foreach($table->primaryKey as $field) { | |
| 85 | +            foreach ($table->primaryKey as $field) { | |
| 86 | 86 |                  $result[] = "{$alias}_{$field}"; | 
| 87 | 87 | } | 
| 88 | 88 | } | 
| @@ -100,10 +100,10 @@ discard block | ||
| 100 | 100 |      { | 
| 101 | 101 | $result = []; | 
| 102 | 102 | |
| 103 | -        while(true) { | |
| 103 | +        while (true) { | |
| 104 | 104 | $result[] = $tableAlias; | 
| 105 | 105 | |
| 106 | -            if(!$joinConditions->issetByJoinAs($tableAlias)) { | |
| 106 | +            if (!$joinConditions->issetByJoinAs($tableAlias)) { | |
| 107 | 107 | break; | 
| 108 | 108 | } | 
| 109 | 109 | |
| @@ -119,7 +119,7 @@ discard block | ||
| 119 | 119 | */ | 
| 120 | 120 | public function getIterator(): Traversable | 
| 121 | 121 |      { | 
| 122 | -        foreach($this->mapByAlias as $table) { | |
| 122 | +        foreach ($this->mapByAlias as $table) { | |
| 123 | 123 | yield $table; | 
| 124 | 124 | } | 
| 125 | 125 | } | 
| @@ -142,7 +142,7 @@ discard block | ||
| 142 | 142 | */ | 
| 143 | 143 | protected function addToMap(string $mapName, string $key, Table $table): self | 
| 144 | 144 |      { | 
| 145 | -        if(isset($this->{$mapName}[$table->{$key}])) { | |
| 145 | +        if (isset($this->{$mapName}[$table->{$key}])) { | |
| 146 | 146 |              throw new QueryRelationManagerException("duplicate key '{$key}' in map '{$mapName}' of TableManager"); | 
| 147 | 147 | } | 
| 148 | 148 |          $this->{$mapName}[$table->{$key}] = $table; | 
| @@ -159,7 +159,7 @@ discard block | ||
| 159 | 159 | */ | 
| 160 | 160 | protected function getFromMap(string $mapName, string $key): Table | 
| 161 | 161 |      { | 
| 162 | -        if(!isset($this->{$mapName}[$key])) { | |
| 162 | +        if (!isset($this->{$mapName}[$key])) { | |
| 163 | 163 |              throw new QueryRelationManagerException("key '{$key}' not found in map '{$mapName}' of TableManager"); | 
| 164 | 164 | } | 
| 165 | 165 | |
| @@ -34,15 +34,15 @@ discard block | ||
| 34 | 34 | */ | 
| 35 | 35 | public function add(JoinCondition $condition): self | 
| 36 | 36 |      { | 
| 37 | -        if(isset($this->mapByJoinAs[$condition->table->alias])) { | |
| 37 | +        if (isset($this->mapByJoinAs[$condition->table->alias])) { | |
| 38 | 38 |              throw new QueryRelationManagerException("duplicate table alias '{$condition->table->alias}'"); | 
| 39 | 39 | } | 
| 40 | 40 | $this->mapByJoinAs[$condition->table->alias] = $condition; | 
| 41 | 41 | |
| 42 | -        if(!isset($this->matrixByJoinTo[$condition->joinTo->alias])) { | |
| 42 | +        if (!isset($this->matrixByJoinTo[$condition->joinTo->alias])) { | |
| 43 | 43 | $this->matrixByJoinTo[$condition->joinTo->alias] = []; | 
| 44 | 44 | } | 
| 45 | -        if(isset($this->matrixByJoinTo[$condition->joinTo->alias][$condition->table->alias])) { | |
| 45 | +        if (isset($this->matrixByJoinTo[$condition->joinTo->alias][$condition->table->alias])) { | |
| 46 | 46 |              throw new QueryRelationManagerException("duplicate table alias '{$condition->table->alias}'"); | 
| 47 | 47 | } | 
| 48 | 48 | $this->matrixByJoinTo[$condition->joinTo->alias][$condition->table->alias] = $condition; | 
| @@ -57,7 +57,7 @@ discard block | ||
| 57 | 57 | */ | 
| 58 | 58 | public function issetByJoinAs(string $joinAs): bool | 
| 59 | 59 |      { | 
| 60 | -        if(!isset($this->mapByJoinAs[$joinAs])) { | |
| 60 | +        if (!isset($this->mapByJoinAs[$joinAs])) { | |
| 61 | 61 | return false; | 
| 62 | 62 | } | 
| 63 | 63 | |
| @@ -82,7 +82,7 @@ discard block | ||
| 82 | 82 | */ | 
| 83 | 83 | public function byJoinTo(string $joinTo): array | 
| 84 | 84 |      { | 
| 85 | -        if(!isset($this->matrixByJoinTo[$joinTo])) { | |
| 85 | +        if (!isset($this->matrixByJoinTo[$joinTo])) { | |
| 86 | 86 | return []; | 
| 87 | 87 | } | 
| 88 | 88 | return $this->matrixByJoinTo[$joinTo]; | 
| @@ -94,7 +94,7 @@ discard block | ||
| 94 | 94 | */ | 
| 95 | 95 | public function getIterator(): Traversable | 
| 96 | 96 |      { | 
| 97 | -        foreach($this->mapByJoinAs as $condition) { | |
| 97 | +        foreach ($this->mapByJoinAs as $condition) { | |
| 98 | 98 | yield $condition; | 
| 99 | 99 | } | 
| 100 | 100 | } |