Completed
Pull Request — master (#219)
by Christopher
06:20
created
src/Models/MetadataKeyMethodNamesTrait.php 2 patches
Braces   +7 added lines, -6 removed lines patch added patch discarded remove patch
@@ -46,16 +46,16 @@  discard block
 block discarded – undo
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
 block discarded – undo
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'])}());
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -35,13 +35,13 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.