Completed
Branch master (8f4d7f)
by Alex
13:09
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/MetadataGubbinsHolder.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -135,7 +135,7 @@
 block discarded – undo
135 135
                     $stub = clone $this->knownSides[$knownType][$key];
136 136
                     $isMulti = ($stub->getMultiplicity()->getValue() == AssociationStubRelationType::MANY);
137 137
                     $relPolyTypeName = substr($lc->getBaseType(), strrpos($lc->getBaseType(), '\\')+1);
138
-                    $relPolyTypeName = str_plural($relPolyTypeName, $isMulti?2:1);
138
+                    $relPolyTypeName = str_plural($relPolyTypeName, $isMulti ? 2 : 1);
139 139
                     $stub->setRelationName($stub->getRelationName() . '_' . $relPolyTypeName);
140 140
                     $assoc = new AssociationMonomorphic();
141 141
                     $first = -1 === $stub->compare($lc);
Please login to merge, or discard this 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/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/Query/LaravelReadQuery.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
             foreach ($orderBy->getOrderByInfo()->getOrderByPathSegments() as $order) {
103 103
                 foreach ($order->getSubPathSegments() as $subOrder) {
104 104
                     $subName = $subOrder->getName();
105
-                    $subName = $tableName.'.'.$subName;
105
+                    $subName = $tableName . '.' . $subName;
106 106
                     $sourceEntityInstance = $sourceEntityInstance->orderBy(
107 107
                         $subName,
108 108
                         $order->isAscending() ? 'asc' : 'desc'
@@ -411,10 +411,10 @@  discard block
 block discarded – undo
411 411
     private function processKeyDescriptor(&$sourceEntityInstance, KeyDescriptor $keyDescriptor = null)
412 412
     {
413 413
         if ($keyDescriptor) {
414
-            $table = ($sourceEntityInstance instanceof Model) ? $sourceEntityInstance->getTable().'.' : '';
414
+            $table = ($sourceEntityInstance instanceof Model) ? $sourceEntityInstance->getTable() . '.' : '';
415 415
             foreach ($keyDescriptor->getValidatedNamedValues() as $key => $value) {
416 416
                 $trimValue = trim($value[0], '\'');
417
-                $sourceEntityInstance = $sourceEntityInstance->where($table.$key, $trimValue);
417
+                $sourceEntityInstance = $sourceEntityInstance->where($table . $key, $trimValue);
418 418
             }
419 419
         }
420 420
     }
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
             }
434 434
             $lineParts = explode('/', $line);
435 435
             $numberOfParts = count($lineParts);
436
-            for ($i = 0; $i<$numberOfParts; $i++) {
436
+            for ($i = 0; $i < $numberOfParts; $i++) {
437 437
                 $lineParts[$i] = $this->getLaravelRelationName($lineParts[$i]);
438 438
             }
439 439
             $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
 
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
                     // so we can't bail out early
520 520
                     $rawCount += $results->count();
521 521
                     // now bolt on filtrate to accumulating result set if we haven't accumulated enough bitz
522
-                    if ($rawTop > $resultSet->count() + $skip) {
522
+                    if ($rawTop > $resultSet->count()+$skip) {
523 523
                         $resultSet = collect(array_merge($resultSet->all(), $results->all()));
524 524
                         $sliceAmount = min($skip, $resultSet->count());
525 525
                         $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
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
         $targClass = $resourceType->getInstanceType()->getName();
184 184
         if (!($entryObject->results instanceof $targClass)) {
185 185
             $msg = 'Object being serialised not instance of expected class, '
186
-                   . $targClass . ', is actually ' . $payloadClass;
186
+                    . $targClass . ', is actually ' . $payloadClass;
187 187
             throw new InvalidOperationException($msg);
188 188
         }
189 189
 
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
             if (!(ResourcePropertyKind::RESOURCESET_REFERENCE == $propKind
238 238
                   || ResourcePropertyKind::RESOURCE_REFERENCE == $propKind)) {
239 239
                 $msg = '$propKind != ResourcePropertyKind::RESOURCESET_REFERENCE &&'
240
-                       .' $propKind != ResourcePropertyKind::RESOURCE_REFERENCE';
240
+                        .' $propKind != ResourcePropertyKind::RESOURCE_REFERENCE';
241 241
                 throw new InvalidOperationException($msg);
242 242
             }
243 243
             $propTail = ResourcePropertyKind::RESOURCE_REFERENCE == $propKind ? 'entry' : 'feed';
@@ -822,10 +822,10 @@  discard block
 block discarded – undo
822 822
     {
823 823
         $queryParameterString = null;
824 824
         foreach ([ODataConstants::HTTPQUERY_STRING_FILTER,
825
-                     ODataConstants::HTTPQUERY_STRING_EXPAND,
826
-                     ODataConstants::HTTPQUERY_STRING_ORDERBY,
827
-                     ODataConstants::HTTPQUERY_STRING_INLINECOUNT,
828
-                     ODataConstants::HTTPQUERY_STRING_SELECT, ] as $queryOption) {
825
+                        ODataConstants::HTTPQUERY_STRING_EXPAND,
826
+                        ODataConstants::HTTPQUERY_STRING_ORDERBY,
827
+                        ODataConstants::HTTPQUERY_STRING_INLINECOUNT,
828
+                        ODataConstants::HTTPQUERY_STRING_SELECT, ] as $queryOption) {
829 829
             $value = $this->getService()->getHost()->getQueryStringItem($queryOption);
830 830
             if (null !== $value) {
831 831
                 if (null !== $queryParameterString) {
@@ -1009,7 +1009,7 @@  discard block
 block discarded – undo
1009 1009
         $typeKind = $resourceType->getResourceTypeKind();
1010 1010
         if (!(ResourceTypeKind::PRIMITIVE() == $typeKind || ResourceTypeKind::COMPLEX() == $typeKind)) {
1011 1011
             $msg = '$bagItemResourceTypeKind != ResourceTypeKind::PRIMITIVE'
1012
-                   .' && $bagItemResourceTypeKind != ResourceTypeKind::COMPLEX';
1012
+                    .' && $bagItemResourceTypeKind != ResourceTypeKind::COMPLEX';
1013 1013
             throw new InvalidOperationException($msg);
1014 1014
         }
1015 1015
         if (null == $result) {
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
@@ -249,17 +249,17 @@
 block discarded – undo
249 249
                             throw new InvalidOperationException($msg);
250 250
                         }
251 251
                         foreach ([
252
-                                     'hasMany',
253
-                                     'hasManyThrough',
254
-                                     'belongsToMany',
255
-                                     'hasOne',
256
-                                     'belongsTo',
257
-                                     'morphOne',
258
-                                     'morphTo',
259
-                                     'morphMany',
260
-                                     'morphToMany',
261
-                                     'morphedByMany'
262
-                                 ] as $relation) {
252
+                                        'hasMany',
253
+                                        'hasManyThrough',
254
+                                        'belongsToMany',
255
+                                        'hasOne',
256
+                                        'belongsTo',
257
+                                        'morphOne',
258
+                                        'morphTo',
259
+                                        'morphMany',
260
+                                        'morphToMany',
261
+                                        'morphedByMany'
262
+                                    ] as $relation) {
263 263
                             $search = '$this->' . $relation . '(';
264 264
                             if (stripos(/* @scrutinizer ignore-type */$code, $search)) {
265 265
                                 //Resolve the relation's model to a Relation object.
Please login to merge, or discard this patch.
src/Providers/MetadataProvider.php 1 patch
Spacing   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     private function implement(Map $objectModel)
130 130
     {
131 131
         $meta = App::make('metadata');
132
-        $namespace = $meta->getContainerNamespace().'.';
132
+        $namespace = $meta->getContainerNamespace() . '.';
133 133
 
134 134
         $entities = $objectModel->getEntities();
135 135
         foreach ($entities as $entity) {
@@ -144,13 +144,13 @@  discard block
 block discarded – undo
144 144
             $entity->setOdataResourceType($entityType);
145 145
             $this->implementProperties($entity);
146 146
             $meta->addResourceSet($pluralName, $entityType);
147
-            $meta->oDataEntityMap[$className] = $meta->oDataEntityMap[$namespace.$entityName];
147
+            $meta->oDataEntityMap[$className] = $meta->oDataEntityMap[$namespace . $entityName];
148 148
         }
149 149
         $metaCount = count($meta->oDataEntityMap);
150 150
         $entityCount = count($entities);
151 151
         $expected = 2 * $entityCount;
152 152
         if ($metaCount != $expected) {
153
-            $msg = 'Expected ' . $expected . ' items, actually got '.$metaCount;
153
+            $msg = 'Expected ' . $expected . ' items, actually got ' . $metaCount;
154 154
             throw new InvalidOperationException($msg);
155 155
         }
156 156
 
@@ -235,8 +235,7 @@  discard block
 block discarded – undo
235 235
 
236 236
             $default = $field->getDefaultValue();
237 237
             $isFieldBool = TypeCode::BOOLEAN == $field->getEdmFieldType();
238
-            $default = $isFieldBool ? ($default ? 'true' : 'false') :
239
-                             is_array($default) ? json_encode($default) : strval($default);
238
+            $default = $isFieldBool ? ($default ? 'true' : 'false') : is_array($default) ? json_encode($default) : strval($default);
240 239
 
241 240
             $meta->addPrimitiveProperty(
242 241
                 $odataEntity,
Please login to merge, or discard this patch.