@@ -206,7 +206,7 @@ |
||
| 206 | 206 | |
| 207 | 207 | $isOk = true; |
| 208 | 208 | $isOk &= $required == $requireResult; |
| 209 | - $isOk &= (null === $this->targType) === (null === $this->foreignFieldName); |
|
| 209 | + $isOk &= (null === $this->targType) === (null === $this->foreignFieldName); |
|
| 210 | 210 | $isOk &= count($this->throughFieldChain) >= 2; |
| 211 | 211 | |
| 212 | 212 | return boolval($isOk); |
@@ -122,13 +122,13 @@ discard block |
||
| 122 | 122 | public function setFields(array $fields): void |
| 123 | 123 | { |
| 124 | 124 | if (0 == count($fields)) { |
| 125 | - $msg = 'Fields array must not be empty for '.$this->getClassName(); |
|
| 125 | + $msg = 'Fields array must not be empty for ' . $this->getClassName(); |
|
| 126 | 126 | throw new \Exception($msg); |
| 127 | 127 | } |
| 128 | 128 | $keys = []; |
| 129 | 129 | foreach ($fields as $propName => $field) { |
| 130 | 130 | if (!$field instanceof EntityField) { |
| 131 | - $msg = 'Fields array must only have EntityField objects for '.$this->getClassName(); |
|
| 131 | + $msg = 'Fields array must only have EntityField objects for ' . $this->getClassName(); |
|
| 132 | 132 | throw new \Exception($msg); |
| 133 | 133 | } |
| 134 | 134 | if ($field->getIsKeyField()) { |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 | if (0 == count($keys)) { |
| 139 | - $msg = 'No key field supplied in fields array for '.$this->getClassName(); |
|
| 139 | + $msg = 'No key field supplied in fields array for ' . $this->getClassName(); |
|
| 140 | 140 | throw new \Exception($msg); |
| 141 | 141 | } |
| 142 | 142 | $this->fields = $fields; |
@@ -188,8 +188,8 @@ |
||
| 188 | 188 | */ |
| 189 | 189 | protected function updateLightStack(int $newCount): void |
| 190 | 190 | { |
| 191 | - $this->lightStack[$newCount - 1]['count']--; |
|
| 192 | - if (0 == $this->lightStack[$newCount - 1]['count']) { |
|
| 191 | + $this->lightStack[$newCount-1]['count']--; |
|
| 192 | + if (0 == $this->lightStack[$newCount-1]['count']) { |
|
| 193 | 193 | array_pop($this->lightStack); |
| 194 | 194 | } |
| 195 | 195 | } |
@@ -226,10 +226,10 @@ |
||
| 226 | 226 | /** @var array<string, array> */ |
| 227 | 227 | private static $fieldOrderCache = [ |
| 228 | 228 | 'BelongsTo' => ['foreignKey', 'ownerKey'], |
| 229 | - 'BelongsToMany' => ['parentKey','foreignPivotKey','relatedPivotKey','relatedKey'], |
|
| 230 | - 'HasOneOrMany' => ['localKey', 'foreignKey' ], |
|
| 229 | + 'BelongsToMany' => ['parentKey', 'foreignPivotKey', 'relatedPivotKey', 'relatedKey'], |
|
| 230 | + 'HasOneOrMany' => ['localKey', 'foreignKey'], |
|
| 231 | 231 | 'HasManyThrough' => ['localKey', 'firstKey', 'secondLocalKey', 'secondKey'], |
| 232 | - 'MorphToMany' => ['parentKey','foreignPivotKey','morphType', 'relatedPivotKey','relatedKey'], |
|
| 232 | + 'MorphToMany' => ['parentKey', 'foreignPivotKey', 'morphType', 'relatedPivotKey', 'relatedKey'], |
|
| 233 | 233 | 'MorphTo' => ['foreignKey', 'morphType', 'ownerKey'], |
| 234 | 234 | 'MorphOneOrMany' => ['localKey', 'morphType', 'foreignKey'], |
| 235 | 235 | ]; |