Completed
Pull Request — master (#165)
by Alex
05:57
created
src/Models/MetadataGubbinsHolder.php 1 patch
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.
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   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
             foreach ($orderBy->getOrderByInfo()->getOrderByPathSegments() as $order) {
101 101
                 foreach ($order->getSubPathSegments() as $subOrder) {
102 102
                     $subName = $subOrder->getName();
103
-                    $subName = $tableName.'.'.$subName;
103
+                    $subName = $tableName . '.' . $subName;
104 104
                     $sourceEntityInstance = $sourceEntityInstance->orderBy(
105 105
                         $subName,
106 106
                         $order->isAscending() ? 'asc' : 'desc'
@@ -401,10 +401,10 @@  discard block
 block discarded – undo
401 401
     private function processKeyDescriptor(&$sourceEntityInstance, KeyDescriptor $keyDescriptor = null)
402 402
     {
403 403
         if ($keyDescriptor) {
404
-            $table = ($sourceEntityInstance instanceof Model) ? $sourceEntityInstance->getTable().'.' : '';
404
+            $table = ($sourceEntityInstance instanceof Model) ? $sourceEntityInstance->getTable() . '.' : '';
405 405
             foreach ($keyDescriptor->getValidatedNamedValues() as $key => $value) {
406 406
                 $trimValue = trim($value[0], '\'');
407
-                $sourceEntityInstance = $sourceEntityInstance->where($table.$key, $trimValue);
407
+                $sourceEntityInstance = $sourceEntityInstance->where($table . $key, $trimValue);
408 408
             }
409 409
         }
410 410
     }
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
             assert(is_string($line), 'Eager-load elements must be non-empty strings');
422 422
             $lineParts = explode('/', $line);
423 423
             $numberOfParts = count($lineParts);
424
-            for ($i = 0; $i<$numberOfParts; $i++) {
424
+            for ($i = 0; $i < $numberOfParts; $i++) {
425 425
                 $lineParts[$i] = $this->getLaravelRelationName($lineParts[$i]);
426 426
             }
427 427
             $remixLine = implode('.', $lineParts);
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
                     // so we can't bail out early
503 503
                     $rawCount += $results->count();
504 504
                     // now bolt on filtrate to accumulating result set if we haven't accumulated enough bitz
505
-                    if ($rawTop > $resultSet->count() + $skip) {
505
+                    if ($rawTop > $resultSet->count()+$skip) {
506 506
                         $resultSet = collect(array_merge($resultSet->all(), $results->all()));
507 507
                         $sliceAmount = min($skip, $resultSet->count());
508 508
                         $resultSet = $resultSet->slice($sliceAmount);
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
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
     private function implement(Map $objectModel)
129 129
     {
130 130
         $meta = App::make('metadata');
131
-        $namespace = $meta->getContainerNamespace().'.';
131
+        $namespace = $meta->getContainerNamespace() . '.';
132 132
 
133 133
         $entities = $objectModel->getEntities();
134 134
         foreach ($entities as $entity) {
@@ -141,12 +141,12 @@  discard block
 block discarded – undo
141 141
             $entity->setOdataResourceType($entityType);
142 142
             $this->implementProperties($entity);
143 143
             $meta->addResourceSet($pluralName, $entityType);
144
-            $meta->oDataEntityMap[$className] = $meta->oDataEntityMap[$namespace.$entityName];
144
+            $meta->oDataEntityMap[$className] = $meta->oDataEntityMap[$namespace . $entityName];
145 145
         }
146 146
         $metaCount = count($meta->oDataEntityMap);
147 147
         $entityCount = count($entities);
148 148
         $expected = 2 * $entityCount;
149
-        assert($metaCount == $expected, 'Expected ' . $expected . ' items, actually got '.$metaCount);
149
+        assert($metaCount == $expected, 'Expected ' . $expected . ' items, actually got ' . $metaCount);
150 150
 
151 151
         if (0 === count($objectModel->getAssociations())) {
152 152
             return;
Please login to merge, or discard this patch.