@@ -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 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | { |
| 23 | 23 | switch (true) { |
| 24 | 24 | case $rel instanceof BelongsTo: |
| 25 | - $key = $rel->{$this->checkMethodNameList($rel, ['getForeignKeyName', 'getForeignKey'])}(); |
|
| 25 | + $key = $rel->{$this->checkMethodNameList($rel, ['getForeignKeyName', 'getForeignKey'])}(); |
|
| 26 | 26 | break; |
| 27 | 27 | case $rel instanceof BelongsToMany: |
| 28 | 28 | $key = $rel->getForeignPivotKeyName(); |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | $key = $rel->getForeignKeyName(); |
| 32 | 32 | break; |
| 33 | 33 | case $rel instanceof HasManyThrough: |
| 34 | - $key = $rel->getQualifiedFarKeyName(); |
|
| 34 | + $key = $rel->getQualifiedFarKeyName(); |
|
| 35 | 35 | break; |
| 36 | 36 | default: |
| 37 | 37 | $msg = sprintf('Unknown Relationship Type %s', get_class($rel)); |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $fileName = $method->getFileName(); |
| 90 | 90 | |
| 91 | 91 | $file = new \SplFileObject($fileName); |
| 92 | - $file->seek($method->getStartLine() - 1); |
|
| 92 | + $file->seek($method->getStartLine()-1); |
|
| 93 | 93 | $code = ''; |
| 94 | 94 | while ($file->key() < $method->getEndLine()) { |
| 95 | 95 | $code .= $file->current(); |
@@ -102,8 +102,8 @@ discard block |
||
| 102 | 102 | throw new InvalidOperationException($msg); |
| 103 | 103 | } |
| 104 | 104 | $begin = strpos($code, 'function('); |
| 105 | - $code = substr($code, $begin, strrpos($code, '}') - $begin + 1); |
|
| 106 | - $lastCode = $code[strlen($code) - 1]; |
|
| 105 | + $code = substr($code, $begin, strrpos($code, '}')-$begin+1); |
|
| 106 | + $lastCode = $code[strlen($code)-1]; |
|
| 107 | 107 | if ('}' != $lastCode) { |
| 108 | 108 | $msg = 'Final character of function definition must be closing brace'; |
| 109 | 109 | throw new InvalidOperationException($msg); |
@@ -148,11 +148,10 @@ discard block |
||
| 148 | 148 | continue; |
| 149 | 149 | } |
| 150 | 150 | $targetClass = $relation == 'morphTo' ? |
| 151 | - '\Illuminate\Database\Eloquent\Model|\Eloquent' : |
|
| 152 | - '\\' . get_class($relObject); |
|
| 151 | + '\Illuminate\Database\Eloquent\Model|\Eloquent' : '\\' . get_class($relObject); |
|
| 153 | 152 | $targObject = $biDir ? $relationObj : $targetClass; |
| 154 | 153 | $relToKeyMap = [ |
| 155 | - 'morphedByMany' => ['UnknownPolyMorphSide','HasMany'], |
|
| 154 | + 'morphedByMany' => ['UnknownPolyMorphSide', 'HasMany'], |
|
| 156 | 155 | 'morphToMany' => ['KnownPolyMorphSide', 'HasMany'], |
| 157 | 156 | 'morphMany' => ['KnownPolyMorphSide', 'HasMany'], |
| 158 | 157 | 'hasMany' => ['HasMany'], |
@@ -191,8 +190,7 @@ discard block |
||
| 191 | 190 | $keyName = $this->polyglotFkKey($relation); |
| 192 | 191 | $localName = $this->polyglotRkKey($relation); |
| 193 | 192 | $thruName = $relation instanceof HasManyThrough ? |
| 194 | - $this->polyglotThroughKey($relation) : |
|
| 195 | - null; |
|
| 193 | + $this->polyglotThroughKey($relation) : null; |
|
| 196 | 194 | |
| 197 | 195 | $first = $keyName; |
| 198 | 196 | $last = $localName; |