Completed
Pull Request — master (#221)
by Christopher
11:18 queued 15s
created
src/Models/ObjectMap/Entities/EntityGubbins.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -119,13 +119,13 @@  discard block
 block discarded – undo
119 119
     public function setFields(array $fields)
120 120
     {
121 121
         if (0 == count($fields)) {
122
-            $msg = 'Fields array must not be empty for '.$this->getClassName();
122
+            $msg = 'Fields array must not be empty for ' . $this->getClassName();
123 123
             throw new \Exception($msg);
124 124
         }
125 125
         $keys = [];
126 126
         foreach ($fields as $propName => $field) {
127 127
             if (!$field instanceof EntityField) {
128
-                $msg = 'Fields array must only have EntityField objects for '.$this->getClassName();
128
+                $msg = 'Fields array must only have EntityField objects for ' . $this->getClassName();
129 129
                 throw new \Exception($msg);
130 130
             }
131 131
             if ($field->getIsKeyField()) {
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
             }
134 134
         }
135 135
         if (0 == count($keys)) {
136
-            $msg = 'No key field supplied in fields array for '.$this->getClassName();
136
+            $msg = 'No key field supplied in fields array for ' . $this->getClassName();
137 137
             throw new \Exception($msg);
138 138
         }
139 139
         $this->fields = $fields;
Please login to merge, or discard this patch.
src/Models/MetadataTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
     public function retrieveCasts()
636 636
     {
637 637
         $exists = method_exists($this, 'getCasts');
638
-        return $exists ? (array)$this->getCasts() : (array)$this->casts;
638
+        return $exists ? (array) $this->getCasts() : (array) $this->casts;
639 639
     }
640 640
 
641 641
     /**
@@ -782,7 +782,7 @@  discard block
 block discarded – undo
782 782
             $builder = $connect->getSchemaBuilder();
783 783
             $columns = $builder->getColumnListing($table);
784 784
 
785
-            self::$tableColumns = (array)$columns;
785
+            self::$tableColumns = (array) $columns;
786 786
         }
787 787
         return self::$tableColumns;
788 788
     }
Please login to merge, or discard this patch.
src/Providers/MetadataProvider.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
     {
136 136
         /** @var SimpleMetadataProvider $meta */
137 137
         $meta = App::make('metadata');
138
-        $namespace = $meta->getContainerNamespace().'.';
138
+        $namespace = $meta->getContainerNamespace() . '.';
139 139
 
140 140
         $entities = $objectModel->getEntities();
141 141
         foreach ($entities as $entity) {
@@ -150,13 +150,13 @@  discard block
 block discarded – undo
150 150
             $entity->setOdataResourceType($entityType);
151 151
             $this->implementProperties($entity);
152 152
             $meta->addResourceSet($pluralName, $entityType);
153
-            $meta->oDataEntityMap[$className] = $meta->oDataEntityMap[$namespace.$entityName];
153
+            $meta->oDataEntityMap[$className] = $meta->oDataEntityMap[$namespace . $entityName];
154 154
         }
155 155
         $metaCount = count($meta->oDataEntityMap);
156 156
         $entityCount = count($entities);
157 157
         $expected = 2 * $entityCount;
158 158
         if ($metaCount != $expected) {
159
-            $msg = 'Expected ' . $expected . ' items, actually got '.$metaCount;
159
+            $msg = 'Expected ' . $expected . ' items, actually got ' . $metaCount;
160 160
             throw new InvalidOperationException($msg);
161 161
         }
162 162
 
Please login to merge, or discard this patch.
src/Query/LaravelReadQueryUtilityTrait.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
         $values = $skipToken->getOrderByKeysInToken();
37 37
         $numValues = count($values);
38 38
         if ($numValues != count($segments)) {
39
-            $msg = 'Expected '.count($segments).', got '.$numValues;
39
+            $msg = 'Expected ' . count($segments) . ', got ' . $numValues;
40 40
             throw new InvalidOperationException($msg);
41 41
         }
42 42
 
Please login to merge, or discard this patch.
src/Query/LaravelReadQuery.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
                     // so we can't bail out early
387 387
                     $rawCount += $results->count();
388 388
                     // now bolt on filtrate to accumulating result set if we haven't accumulated enough bitz
389
-                    if ($rawTop > $resultSet->count() + $skip) {
389
+                    if ($rawTop > $resultSet->count()+$skip) {
390 390
                         $resultSet = collect(array_merge($resultSet->all(), $results->all()));
391 391
                         $sliceAmount = min($skip, $resultSet->count());
392 392
                         $resultSet = $resultSet->slice($sliceAmount);
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
         if (QueryType::COUNT() == $qVal || QueryType::ENTITIES_WITH_COUNT() == $qVal) {
462 462
             $result->count = $resultCount;
463 463
         }
464
-        $hazMore = $bulkSetCount > $skip + count($resultSet);
464
+        $hazMore = $bulkSetCount > $skip+count($resultSet);
465 465
         $result->hasMore = $hazMore;
466 466
     }
467 467
 }
Please login to merge, or discard this patch.
src/Serialisers/SerialiseDepWrapperTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -186,8 +186,8 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Providers/MetadataBaseProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
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
     }
Please login to merge, or discard this patch.
src/Models/ObjectMap/Entities/Associations/AssociationStubFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
     private static function getKeyChain(Relation $relation, string $cacheKey) : array
229 229
     {
230 230
         $fields = self::$fieldOrderCache[$cacheKey];
231
-        $getter =  function () use ($fields) {
231
+        $getter = function () use ($fields) {
232 232
             $carry = [];
233 233
             foreach ($fields as $item) {
234 234
                 $v = $this->{$item};
@@ -246,8 +246,8 @@  discard block
 block discarded – undo
246 246
 
247 247
     private static $fieldOrderCache = [
248 248
         'BelongsTo' => ['ownerKey', 'foreignKey'],
249
-        'BelongsToMany' => ['parentKey','foreignPivotKey','relatedPivotKey','relatedKey'],
250
-        'HasOneOrMany' => ['localKey', 'foreignKey' ],
249
+        'BelongsToMany' => ['parentKey', 'foreignPivotKey', 'relatedPivotKey', 'relatedKey'],
250
+        'HasOneOrMany' => ['localKey', 'foreignKey'],
251 251
         'HasManyThrough' => ['localKey', 'firstKey', 'secondLocalKey', 'secondKey'],
252 252
 
253 253
     ];
Please login to merge, or discard this patch.
src/Models/MetadataRelationsTrait.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
         $fileName = $method->getFileName();
72 72
 
73 73
         $file = new \SplFileObject($fileName);
74
-        $file->seek($method->getStartLine() - 1);
74
+        $file->seek($method->getStartLine()-1);
75 75
         $code = '';
76 76
         while ($file->key() < $method->getEndLine()) {
77 77
             $code .= $file->current();
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
             throw new InvalidOperationException($msg);
85 85
         }
86 86
         $begin = strpos($code, 'function(');
87
-        $code = substr($code, $begin, strrpos($code, '}') - $begin + 1);
88
-        $lastCode = $code[strlen($code) - 1];
87
+        $code = substr($code, $begin, strrpos($code, '}')-$begin+1);
88
+        $lastCode = $code[strlen($code)-1];
89 89
         if ('}' != $lastCode) {
90 90
             $msg = 'Final character of function definition must be closing brace';
91 91
             throw new InvalidOperationException($msg);
@@ -137,12 +137,12 @@  discard block
 block discarded – undo
137 137
                 ) {
138 138
                     continue;
139 139
                 }
140
-                if (in_array($relation, ['morphedByMany','morphTo'])) {
140
+                if (in_array($relation, ['morphedByMany', 'morphTo'])) {
141 141
                     $this->hasUnknownPolymorphic = true;
142
-                } elseif (in_array($relation, ['morphOne','morphMany','morphToMany'])) {
142
+                } elseif (in_array($relation, ['morphOne', 'morphMany', 'morphToMany'])) {
143 143
                     $this->hasKnownPolymorphic = true;
144 144
                 }
145
-                $relationships[]= $method;
145
+                $relationships[] = $method;
146 146
             }
147 147
         }
148 148
         return $relationships;
Please login to merge, or discard this patch.