@@ -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 | } |
@@ -46,16 +46,16 @@ discard block |
||
| 46 | 46 | $fkList = ['getForeignKeyName', 'getForeignKey']; |
| 47 | 47 | // getOwnerKeyName for laravel 5.5 |
| 48 | 48 | $rkList = ['getOwnerKey', 'getOwnerKeyName']; |
| 49 | - }elseif ($foo instanceof BelongsToMany) { |
|
| 49 | + } elseif ($foo instanceof BelongsToMany) { |
|
| 50 | 50 | $fkList = ['getForeignPivotKeyName']; |
| 51 | 51 | $rkList = ['getRelatedPivotKeyName']; |
| 52 | - }elseif($foo instanceof HasOneOrMany){ |
|
| 52 | + } elseif($foo instanceof HasOneOrMany) { |
|
| 53 | 53 | $fkList = ['getForeignKeyName']; |
| 54 | 54 | $rkList = ['getLocalKeyName', 'getQualifiedParentKeyName']; |
| 55 | - }elseif($foo instanceof HasManyThrough) { |
|
| 55 | + } elseif($foo instanceof HasManyThrough) { |
|
| 56 | 56 | $fkList = ['getQualifiedFarKeyName']; |
| 57 | 57 | $rkList = ['getQualifiedParentKeyName']; |
| 58 | - }else{ |
|
| 58 | + } else { |
|
| 59 | 59 | $msg = sprintf('Unknown Relationship Type %s', get_class($foo)); |
| 60 | 60 | throw new InvalidOperationException($msg); |
| 61 | 61 | } |
@@ -101,8 +101,9 @@ discard block |
||
| 101 | 101 | } |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | - protected function polyglotThroughKey(Relation $rel){ |
|
| 105 | - if(! $rel instanceof HasManyThrough){ |
|
| 104 | + protected function polyglotThroughKey(Relation $rel) |
|
| 105 | + { |
|
| 106 | + if(! $rel instanceof HasManyThrough) { |
|
| 106 | 107 | return null; |
| 107 | 108 | } |
| 108 | 109 | $segments = explode('.', $rel->{$this->checkMethodNameList($rel, ['getThroughKey', 'getQualifiedFirstKeyName'])}()); |
@@ -35,13 +35,13 @@ discard block |
||
| 35 | 35 | }elseif ($foo instanceof BelongsToMany) { |
| 36 | 36 | $fkList = ['getForeignPivotKeyName']; |
| 37 | 37 | $rkList = ['getRelatedPivotKeyName']; |
| 38 | - }elseif($foo instanceof HasOneOrMany){ |
|
| 38 | + }elseif ($foo instanceof HasOneOrMany) { |
|
| 39 | 39 | $fkList = ['getForeignKeyName']; |
| 40 | 40 | $rkList = ['getLocalKeyName', 'getQualifiedParentKeyName']; |
| 41 | - }elseif($foo instanceof HasManyThrough) { |
|
| 41 | + }elseif ($foo instanceof HasManyThrough) { |
|
| 42 | 42 | $fkList = ['getQualifiedFarKeyName']; |
| 43 | 43 | $rkList = ['getQualifiedParentKeyName']; |
| 44 | - }else{ |
|
| 44 | + } else { |
|
| 45 | 45 | $msg = sprintf('Unknown Relationship Type %s', get_class($foo)); |
| 46 | 46 | throw new InvalidOperationException($msg); |
| 47 | 47 | } |
@@ -87,8 +87,8 @@ discard block |
||
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | - protected function polyglotThroughKey(Relation $rel){ |
|
| 91 | - if(! $rel instanceof HasManyThrough){ |
|
| 90 | + protected function polyglotThroughKey(Relation $rel) { |
|
| 91 | + if (!$rel instanceof HasManyThrough) { |
|
| 92 | 92 | return null; |
| 93 | 93 | } |
| 94 | 94 | $segments = explode('.', $rel->{$this->checkMethodNameList($rel, ['getThroughKey', 'getQualifiedFirstKeyName'])}()); |
@@ -136,6 +136,6 @@ discard block |
||
| 136 | 136 | } |
| 137 | 137 | } |
| 138 | 138 | $msg = 'Expected at least 1 element in related-key list, got 0 for relation %s'; |
| 139 | - throw new InvalidOperationException(sprintf($msg,get_class($foo))); |
|
| 139 | + throw new InvalidOperationException(sprintf($msg, get_class($foo))); |
|
| 140 | 140 | } |
| 141 | 141 | } |