@@ -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); |
@@ -140,13 +140,13 @@ discard block |
||
140 | 140 | foreach (static::$relTypes as $relation) { |
141 | 141 | //Resolve the relation's model to a Relation object. |
142 | 142 | if ( |
143 | - !stripos($code, sprintf('$this->%s(',$relation)) || |
|
143 | + !stripos($code, sprintf('$this->%s(', $relation)) || |
|
144 | 144 | !(($relationObj = $model->$method()) instanceof Relation) || |
145 | 145 | !in_array(MetadataTrait::class, class_uses($relObject = $relationObj->getRelated())) |
146 | 146 | ) { |
147 | 147 | continue; |
148 | 148 | } |
149 | - $targObject = $biDir ? $relationObj : '\\' . get_class($relObject);; |
|
149 | + $targObject = $biDir ? $relationObj : '\\' . get_class($relObject); ; |
|
150 | 150 | if (in_array($relation, static::$manyRelTypes)) { |
151 | 151 | //Collection or array of models (because Collection is Arrayable) |
152 | 152 | $relationships['HasMany'][$method] = $targObject; |
@@ -189,8 +189,7 @@ discard block |
||
189 | 189 | $keyName = $this->polyglotFkKey($relation); |
190 | 190 | $localName = $this->polyglotRkKey($relation); |
191 | 191 | $thruName = $relation instanceof HasManyThrough ? |
192 | - $this->polyglotThroughKey($relation) : |
|
193 | - null; |
|
192 | + $this->polyglotThroughKey($relation) : null; |
|
194 | 193 | |
195 | 194 | $first = $keyName; |
196 | 195 | $last = $localName; |