@@ -186,8 +186,8 @@ |
||
186 | 186 | */ |
187 | 187 | protected function updateLightStack(int $newCount) |
188 | 188 | { |
189 | - $this->lightStack[$newCount - 1]['count']--; |
|
190 | - if (0 == $this->lightStack[$newCount - 1]['count']) { |
|
189 | + $this->lightStack[$newCount-1]['count']--; |
|
190 | + if (0 == $this->lightStack[$newCount-1]['count']) { |
|
191 | 191 | array_pop($this->lightStack); |
192 | 192 | } |
193 | 193 | } |
@@ -63,7 +63,7 @@ |
||
63 | 63 | { |
64 | 64 | $class = __CLASS__; |
65 | 65 | if (!isset($classMap[$class])) { |
66 | - throw new \Exception(sprintf('%s was not found in autoload class map, this usually indicates you '. |
|
66 | + throw new \Exception(sprintf('%s was not found in autoload class map, this usually indicates you ' . |
|
67 | 67 | 'need to dump an optimised autoloader (`composer dump-autoload -o`)', $class)); |
68 | 68 | } |
69 | 69 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | $fileName = $method->getFileName(); |
43 | 43 | |
44 | 44 | $file = new \SplFileObject($fileName); |
45 | - $file->seek($method->getStartLine() - 1); |
|
45 | + $file->seek($method->getStartLine()-1); |
|
46 | 46 | $code = ''; |
47 | 47 | while ($file->key() < $method->getEndLine()) { |
48 | 48 | $code .= $file->current(); |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | |
52 | 52 | $code = trim(preg_replace('/\s\s+/', '', $code)); |
53 | 53 | $begin = strpos($code, 'function('); |
54 | - $code = substr($code, $begin, strrpos($code, '}') - $begin + 1); |
|
55 | - $lastCode = $code[strlen($code) - 1]; |
|
54 | + $code = substr($code, $begin, strrpos($code, '}')-$begin+1); |
|
55 | + $lastCode = $code[strlen($code)-1]; |
|
56 | 56 | |
57 | 57 | return $code; |
58 | 58 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | ) { |
102 | 102 | continue; |
103 | 103 | } |
104 | - $relationships[]= $method; |
|
104 | + $relationships[] = $method; |
|
105 | 105 | } |
106 | 106 | } |
107 | 107 | return $relationships; |
@@ -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 | ]; |