@@ -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'])}()); |