@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | private static function getKeyChain(Relation $relation, string $cacheKey) : array |
| 240 | 240 | { |
| 241 | 241 | $fields = self::$fieldOrderCache[$cacheKey]; |
| 242 | - $getter = function () use ($fields) { |
|
| 242 | + $getter = function () use ($fields) { |
|
| 243 | 243 | $carry = []; |
| 244 | 244 | foreach ($fields as $item) { |
| 245 | 245 | $v = $this->{$item}; |
@@ -258,12 +258,12 @@ discard block |
||
| 258 | 258 | |
| 259 | 259 | private static $fieldOrderCache = [ |
| 260 | 260 | 'BelongsTo' => ['foreignKey', 'ownerKey'], |
| 261 | - 'BelongsToMany' => ['parentKey','foreignPivotKey','relatedPivotKey','relatedKey'], |
|
| 262 | - 'HasOneOrMany' => ['localKey', 'foreignKey' ], |
|
| 261 | + 'BelongsToMany' => ['parentKey', 'foreignPivotKey', 'relatedPivotKey', 'relatedKey'], |
|
| 262 | + 'HasOneOrMany' => ['localKey', 'foreignKey'], |
|
| 263 | 263 | 'HasManyThrough' => ['localKey', 'firstKey', 'secondLocalKey', 'secondKey'], |
| 264 | - 'MorphToMany' => ['parentKey','foreignPivotKey','morphType', 'relatedPivotKey','relatedKey'], |
|
| 264 | + 'MorphToMany' => ['parentKey', 'foreignPivotKey', 'morphType', 'relatedPivotKey', 'relatedKey'], |
|
| 265 | 265 | 'MorphTo' => ['foreignKey', 'morphType', 'ownerKey'], |
| 266 | - 'MorphOneOrMany' => ['foreignKey', 'morphType', 'localKey' ], |
|
| 266 | + 'MorphOneOrMany' => ['foreignKey', 'morphType', 'localKey'], |
|
| 267 | 267 | 'inverse' => ['inverse'], // TODO: currently used to get inverse, should be removed when morephtomany is fixed |
| 268 | 268 | |
| 269 | 269 | ]; |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | $fileName = $method->getFileName(); |
| 35 | 35 | |
| 36 | 36 | $file = new SplFileObject($fileName); |
| 37 | - $file->seek($method->getStartLine() - 1); |
|
| 37 | + $file->seek($method->getStartLine()-1); |
|
| 38 | 38 | $code = ''; |
| 39 | 39 | while ($file->key() < $method->getEndLine()) { |
| 40 | 40 | $code .= $file->current(); |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | |
| 44 | 44 | $code = trim(preg_replace('/\s\s+/', '', $code)); |
| 45 | 45 | $begin = strpos($code, 'function('); |
| 46 | - $code = substr($code, $begin, strrpos($code, '}') - $begin + 1); |
|
| 46 | + $code = substr($code, $begin, strrpos($code, '}')-$begin+1); |
|
| 47 | 47 | return $code; |
| 48 | 48 | } |
| 49 | 49 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | ) { |
| 85 | 85 | continue; |
| 86 | 86 | } |
| 87 | - $relationships[]= $method; |
|
| 87 | + $relationships[] = $method; |
|
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | return $relationships; |
@@ -32,6 +32,6 @@ |
||
| 32 | 32 | */ |
| 33 | 33 | public function getRelationships() |
| 34 | 34 | { |
| 35 | - return self::$relationNames = self::$relationNames ?? ModelReflectionHelper::getRelationshipsFromMethods(/** @scrutinizer ignore-type */$this); |
|
| 35 | + return self::$relationNames = self::$relationNames ?? ModelReflectionHelper::getRelationshipsFromMethods(/** @scrutinizer ignore-type */$this); |
|
| 36 | 36 | } |
| 37 | 37 | } |