Passed
Pull Request — master (#201)
by Alex
06:08
created
src/Query/LaravelExpressionProvider.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@
 block discarded – undo
54 54
         };
55 55
         $this->functionDescriptionParsers[ODataConstants::STRFUN_ENDSWITH] = function ($params) {
56 56
             return '(strcmp(substr(' . $params[0] . ', strlen(' . $params[0] . ') - strlen(' . $params[1] . ')), '
57
-                   .$params[1] . ') === 0)';
57
+                    .$params[1] . ') === 0)';
58 58
         };
59 59
         $this->functionDescriptionParsers[ODataConstants::STRFUN_INDEXOF] = function ($params) {
60 60
             return 'strpos(' . $params[0] . ', ' . $params[1] . ')';
Please login to merge, or discard this patch.
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/MetadataGubbinsHolder.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
             $others = $this->getRelationsByRelationName($className, $relName);
71 71
             if ($stub instanceof AssociationStubMonomorphic) {
72 72
                 $msg = 'Monomorphic relation stub on ' . $className . ' ' . $relName
73
-                       . ' should point to at most 1 other stub';
73
+                        . ' should point to at most 1 other stub';
74 74
                 if (!(1 >= count($others))) {
75 75
                     throw new InvalidOperationException($msg);
76 76
                 }
Please login to merge, or discard this patch.
src/Models/MetadataTrait.php 2 patches
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.
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -253,17 +253,17 @@
 block discarded – undo
253 253
                     throw new InvalidOperationException($msg);
254 254
                 }
255 255
                 foreach ([
256
-                             'hasMany',
257
-                             'hasManyThrough',
258
-                             'belongsToMany',
259
-                             'hasOne',
260
-                             'belongsTo',
261
-                             'morphOne',
262
-                             'morphTo',
263
-                             'morphMany',
264
-                             'morphToMany',
265
-                             'morphedByMany'
266
-                         ] as $relation) {
256
+                                'hasMany',
257
+                                'hasManyThrough',
258
+                                'belongsToMany',
259
+                                'hasOne',
260
+                                'belongsTo',
261
+                                'morphOne',
262
+                                'morphTo',
263
+                                'morphMany',
264
+                                'morphToMany',
265
+                                'morphedByMany'
266
+                            ] as $relation) {
267 267
                     $search = '$this->' . $relation . '(';
268 268
                     $found = stripos(/** @scrutinizer ignore-type */$code, $search);
269 269
                     if (!$found) {
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/LaravelWriteQuery.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -140,7 +140,7 @@
 block discarded – undo
140 140
             $msg = 'Data must not be null';
141 141
             throw new InvalidOperationException($msg);
142 142
         }
143
-        $arrayData = is_object($data) ? (array)$data : $data;
143
+        $arrayData = is_object($data) ? (array) $data : $data;
144 144
         if (!is_array($arrayData)) {
145 145
             throw ODataException::createPreConditionFailedError(
146 146
                 'Data not resolvable to key-value array.'
Please login to merge, or discard this patch.
src/Query/LaravelReadQuery.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
             foreach ($orderBy->getOrderByInfo()->getOrderByPathSegments() as $order) {
84 84
                 foreach ($order->getSubPathSegments() as $subOrder) {
85 85
                     $subName = $subOrder->getName();
86
-                    $subName = $tableName.'.'.$subName;
86
+                    $subName = $tableName . '.' . $subName;
87 87
                     $sourceEntityInstance = $sourceEntityInstance->orderBy(
88 88
                         $subName,
89 89
                         $order->isAscending() ? 'asc' : 'desc'
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
         if (QueryType::COUNT() == $qVal || QueryType::ENTITIES_WITH_COUNT() == $qVal) {
139 139
             $result->count = $resultCount;
140 140
         }
141
-        $hazMore = $bulkSetCount > $skip + count($resultSet);
141
+        $hazMore = $bulkSetCount > $skip+count($resultSet);
142 142
         $result->hasMore = $hazMore;
143 143
         return $result;
144 144
     }
@@ -404,10 +404,10 @@  discard block
 block discarded – undo
404 404
     private function processKeyDescriptor(&$sourceEntityInstance, KeyDescriptor $keyDescriptor = null)
405 405
     {
406 406
         if ($keyDescriptor) {
407
-            $table = ($sourceEntityInstance instanceof Model) ? $sourceEntityInstance->getTable().'.' : '';
407
+            $table = ($sourceEntityInstance instanceof Model) ? $sourceEntityInstance->getTable() . '.' : '';
408 408
             foreach ($keyDescriptor->getValidatedNamedValues() as $key => $value) {
409 409
                 $trimValue = trim($value[0], '\'');
410
-                $sourceEntityInstance = $sourceEntityInstance->where($table.$key, $trimValue);
410
+                $sourceEntityInstance = $sourceEntityInstance->where($table . $key, $trimValue);
411 411
             }
412 412
         }
413 413
     }
@@ -427,7 +427,7 @@  discard block
 block discarded – undo
427 427
             }
428 428
             $lineParts = explode('/', $line);
429 429
             $numberOfParts = count($lineParts);
430
-            for ($i = 0; $i<$numberOfParts; $i++) {
430
+            for ($i = 0; $i < $numberOfParts; $i++) {
431 431
                 $lineParts[$i] = $this->getLaravelRelationName($lineParts[$i]);
432 432
             }
433 433
             $remixLine = implode('.', $lineParts);
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
         $values = $skipToken->getOrderByKeysInToken();
465 465
         $numValues = count($values);
466 466
         if ($numValues != count($segments)) {
467
-            $msg = 'Expected '.count($segments).', got '.$numValues;
467
+            $msg = 'Expected ' . count($segments) . ', got ' . $numValues;
468 468
             throw new InvalidOperationException($msg);
469 469
         }
470 470
 
@@ -536,7 +536,7 @@  discard block
 block discarded – undo
536 536
                     // so we can't bail out early
537 537
                     $rawCount += $results->count();
538 538
                     // now bolt on filtrate to accumulating result set if we haven't accumulated enough bitz
539
-                    if ($rawTop > $resultSet->count() + $skip) {
539
+                    if ($rawTop > $resultSet->count()+$skip) {
540 540
                         $resultSet = collect(array_merge($resultSet->all(), $results->all()));
541 541
                         $sliceAmount = min($skip, $resultSet->count());
542 542
                         $resultSet = $resultSet->slice($sliceAmount);
Please login to merge, or discard this patch.
src/Serialisers/IronicSerialiser.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
         $targClass = $resourceType->getInstanceType()->getName();
190 190
         if (!($res instanceof $targClass)) {
191 191
             $msg = 'Object being serialised not instance of expected class, '
192
-                   . $targClass . ', is actually ' . $payloadClass;
192
+                    . $targClass . ', is actually ' . $payloadClass;
193 193
             throw new InvalidOperationException($msg);
194 194
         }
195 195
 
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
             if (!(ResourcePropertyKind::RESOURCESET_REFERENCE == $propKind
252 252
                   || ResourcePropertyKind::RESOURCE_REFERENCE == $propKind)) {
253 253
                 $msg = '$propKind != ResourcePropertyKind::RESOURCESET_REFERENCE &&'
254
-                       .' $propKind != ResourcePropertyKind::RESOURCE_REFERENCE';
254
+                        .' $propKind != ResourcePropertyKind::RESOURCE_REFERENCE';
255 255
                 throw new InvalidOperationException($msg);
256 256
             }
257 257
             $propTail = ResourcePropertyKind::RESOURCE_REFERENCE == $propKind ? 'entry' : 'feed';
@@ -877,10 +877,10 @@  discard block
 block discarded – undo
877 877
         /** @var string|null $queryParameterString */
878 878
         $queryParameterString = null;
879 879
         foreach ([ODataConstants::HTTPQUERY_STRING_FILTER,
880
-                     ODataConstants::HTTPQUERY_STRING_EXPAND,
881
-                     ODataConstants::HTTPQUERY_STRING_ORDERBY,
882
-                     ODataConstants::HTTPQUERY_STRING_INLINECOUNT,
883
-                     ODataConstants::HTTPQUERY_STRING_SELECT, ] as $queryOption) {
880
+                        ODataConstants::HTTPQUERY_STRING_EXPAND,
881
+                        ODataConstants::HTTPQUERY_STRING_ORDERBY,
882
+                        ODataConstants::HTTPQUERY_STRING_INLINECOUNT,
883
+                        ODataConstants::HTTPQUERY_STRING_SELECT, ] as $queryOption) {
884 884
             /** @var string|null $value */
885 885
             $value = $this->getService()->getHost()->getQueryStringItem($queryOption);
886 886
             if (null !== $value) {
@@ -1082,7 +1082,7 @@  discard block
 block discarded – undo
1082 1082
         $kVal = $typeKind;
1083 1083
         if (!(ResourceTypeKind::PRIMITIVE() == $kVal || ResourceTypeKind::COMPLEX() == $kVal)) {
1084 1084
             $msg = '$bagItemResourceTypeKind != ResourceTypeKind::PRIMITIVE'
1085
-                   .' && $bagItemResourceTypeKind != ResourceTypeKind::COMPLEX';
1085
+                    .' && $bagItemResourceTypeKind != ResourceTypeKind::COMPLEX';
1086 1086
             throw new InvalidOperationException($msg);
1087 1087
         }
1088 1088
         if (null == $result) {
Please login to merge, or discard this patch.