Completed
Pull Request — master (#63)
by Christopher
05:17
created
src/POData/UriProcessor/QueryProcessor/OrderByParser/OrderByLeafNode.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
 
103 103
         $a = $this->_isAscending ? 1 : -1;
104 104
 
105
-        $retVal = function ($object1, $object2) use ($ancestors, $a) {
105
+        $retVal = function($object1, $object2) use ($ancestors, $a) {
106 106
             $accessor1 = $object1;
107 107
             $accessor2 = $object2;
108 108
             $flag1 = is_null($accessor1);
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
                 $flag2 |= is_null($accessor2);
118 118
             }
119 119
             $propertyName = $this->propertyName;
120
-            $getter = 'get'.ucfirst($propertyName);
120
+            $getter = 'get' . ucfirst($propertyName);
121 121
             if (!is_null($accessor1)) {
122 122
                 $accessor1 = method_exists($accessor1, $getter) ? $accessor1->$getter() : $accessor1->$propertyName;
123 123
             }
@@ -131,9 +131,9 @@  discard block
 block discarded – undo
131 131
             if ($flag1 && $flag2) {
132 132
                 return 0;
133 133
             } elseif ($flag1) {
134
-                return $a * -1;
134
+                return $a*-1;
135 135
             } elseif ($flag2) {
136
-                return $a * 1;
136
+                return $a*1;
137 137
             }
138 138
             $type = $this->resourceProperty->getInstanceType();
139 139
             if ($type instanceof DateTime) {
@@ -144,10 +144,10 @@  discard block
 block discarded – undo
144 144
                 $result = strcmp($accessor1, $accessor2);
145 145
             } else {
146 146
                 $delta = $accessor1 - $accessor2;
147
-                $result = (0 == $delta) ? 0 : $delta / abs($delta);
147
+                $result = (0 == $delta) ? 0 : $delta/abs($delta);
148 148
             }
149 149
 
150
-            return $a * $result;
150
+            return $a*$result;
151 151
         };
152 152
 
153 153
         return $retVal;
Please login to merge, or discard this patch.
POData/UriProcessor/QueryProcessor/OrderByParser/InternalOrderByInfo.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -181,7 +181,7 @@
 block discarded – undo
181 181
                         // Also we can think about moving above urlencode to this
182 182
                         // function
183 183
                         $value = $type->convertToOData($currentObject);
184
-                        $nextPageLink .= $value.', ';
184
+                        $nextPageLink .= $value . ', ';
185 185
                     }
186 186
                 } catch (\ReflectionException $reflectionException) {
187 187
                     throw ODataException::createInternalServerError(
Please login to merge, or discard this patch.
src/POData/UriProcessor/QueryProcessor/OrderByParser/OrderByParser.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -400,7 +400,7 @@  discard block
 block discarded – undo
400 400
             $this->_topLevelComparisonFunction = $this->_comparisonFunctions[0];
401 401
         } else {
402 402
             $funcList = $this->_comparisonFunctions;
403
-            $BigFunc = function ($object1, $object2) use ($funcList) {
403
+            $BigFunc = function($object1, $object2) use ($funcList) {
404 404
                 $ret = 0;
405 405
                 foreach ($funcList as $f) {
406 406
                     $ret = $f($object1, $object2);
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
                             $lexer->validateToken(ExpressionTokenId::DOT);
450 450
                         }
451 451
 
452
-                        $orderByPathSegments[$i][] = '*'.$identifier;
452
+                        $orderByPathSegments[$i][] = '*' . $identifier;
453 453
                         $lexer->nextToken();
454 454
                         $tokenId = $lexer->getCurrentToken()->Id;
455 455
                         if ($tokenId != ExpressionTokenId::END) {
Please login to merge, or discard this patch.
src/POData/ObjectModel/NavigationPropertyInfo.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
      * @param bool             $expanded          Whether the navigation is expanded
22 22
      *                                            or not
23 23
      */
24
-    public function __construct(ResourceProperty &$resourceProperty, $expanded)
24
+    public function __construct(ResourceProperty & $resourceProperty, $expanded)
25 25
     {
26 26
         $this->resourceProperty = $resourceProperty;
27 27
         $this->expanded = $expanded;
Please login to merge, or discard this patch.
src/POData/ObjectModel/ObjectModelSerializerBase.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
         $this->service = $service;
74 74
         $this->request = $request;
75 75
         $this->absoluteServiceUri = $service->getHost()->getAbsoluteServiceUri()->getUrlAsString();
76
-        $this->absoluteServiceUriWithSlash = rtrim($this->absoluteServiceUri, '/').'/';
76
+        $this->absoluteServiceUriWithSlash = rtrim($this->absoluteServiceUri, '/') . '/';
77 77
         $this->stack = new SegmentStack($request);
78 78
         $this->complexTypeInstanceCollection = [];
79 79
     }
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
     {
141 141
         $keyProperties = $resourceType->getKeyProperties();
142 142
         assert(count($keyProperties) != 0, 'count($keyProperties) == 0');
143
-        $keyString = $containerName.'(';
143
+        $keyString = $containerName . '(';
144 144
         $comma = null;
145 145
         foreach ($keyProperties as $keyName => $resourceProperty) {
146 146
             $keyType = $resourceProperty->getInstanceType();
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
             }
154 154
 
155 155
             $keyValue = $keyType->convertToOData($keyValue);
156
-            $keyString .= $comma.$keyName.'='.$keyValue;
156
+            $keyString .= $comma . $keyName . '=' . $keyValue;
157 157
             $comma = ',';
158 158
         }
159 159
 
@@ -233,9 +233,9 @@  discard block
 block discarded – undo
233 233
             assert(!is_null($type) && $type instanceof IType, 'is_null($type) || $type not instanceof IType');
234 234
             $value = $this->getPropertyValue($entryObject, $resourceType, $eTagProperty);
235 235
             if (is_null($value)) {
236
-                $eTag = $eTag.$comma.'null';
236
+                $eTag = $eTag . $comma . 'null';
237 237
             } else {
238
-                $eTag = $eTag.$comma.$type->convertToOData($value);
238
+                $eTag = $eTag . $comma . $type->convertToOData($value);
239 239
             }
240 240
 
241 241
             $comma = ',';
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
             // want this for eTag value.
248 248
             $eTag = urldecode(utf8_decode($eTag));
249 249
 
250
-            return ODataConstants::HTTP_WEAK_ETAG_PREFIX.rtrim($eTag, ',').'"';
250
+            return ODataConstants::HTTP_WEAK_ETAG_PREFIX . rtrim($eTag, ',') . '"';
251 251
         }
252 252
     }
253 253
 
@@ -282,7 +282,7 @@  discard block
 block discarded – undo
282 282
      *
283 283
      * @return bool true if a segment was pushed, false otherwise
284 284
      */
285
-    protected function pushSegmentForNavigationProperty(ResourceProperty &$resourceProperty)
285
+    protected function pushSegmentForNavigationProperty(ResourceProperty & $resourceProperty)
286 286
     {
287 287
         if (ResourceTypeKind::ENTITY == $resourceProperty->getTypeKind()) {
288 288
             assert(!empty($this->getStack()->getSegmentNames()), 'Segment names should not be empty');
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
      *
394 394
      * @return bool true if the segment was push, false otherwise
395 395
      */
396
-    private function _pushSegment($segmentName, ResourceSetWrapper &$resourceSetWrapper)
396
+    private function _pushSegment($segmentName, ResourceSetWrapper & $resourceSetWrapper)
397 397
     {
398 398
         // Even though there is no expand in the request URI, still we need to push
399 399
         // the segment information if we need to count
@@ -429,10 +429,10 @@  discard block
 block discarded – undo
429 429
             $queryParameterString = $this->getNextPageLinkQueryParametersForExpandedResourceSet();
430 430
         }
431 431
 
432
-        $queryParameterString .= '$skip='.$skipToken;
432
+        $queryParameterString .= '$skip=' . $skipToken;
433 433
         $odataLink = new ODataLink();
434 434
         $odataLink->name = ODataConstants::ATOM_LINK_NEXT_ATTRIBUTE_STRING;
435
-        $odataLink->url = rtrim($absoluteUri, '/').'?'.$queryParameterString;
435
+        $odataLink->url = rtrim($absoluteUri, '/') . '?' . $queryParameterString;
436 436
 
437 437
         return $odataLink;
438 438
     }
@@ -457,10 +457,10 @@  discard block
 block discarded – undo
457 457
             $value = $this->getService()->getHost()->getQueryStringItem($queryOption);
458 458
             if (!is_null($value)) {
459 459
                 if (!is_null($queryParameterString)) {
460
-                    $queryParameterString = $queryParameterString.'&';
460
+                    $queryParameterString = $queryParameterString . '&';
461 461
                 }
462 462
 
463
-                $queryParameterString .= $queryOption.'='.$value;
463
+                $queryParameterString .= $queryOption . '=' . $value;
464 464
             }
465 465
         }
466 466
 
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
                 $queryParameterString .= '&';
472 472
             }
473 473
 
474
-            $queryParameterString .= ODataConstants::HTTPQUERY_STRING_TOP.'='.$remainingCount;
474
+            $queryParameterString .= ODataConstants::HTTPQUERY_STRING_TOP . '=' . $remainingCount;
475 475
         }
476 476
 
477 477
         if (!is_null($queryParameterString)) {
@@ -514,7 +514,7 @@  discard block
 block discarded – undo
514 514
             }
515 515
 
516 516
             if (!is_null($selectionPaths)) {
517
-                $queryParameterString = '$select='.$selectionPaths;
517
+                $queryParameterString = '$select=' . $selectionPaths;
518 518
             }
519 519
 
520 520
             if (!is_null($expansionPaths)) {
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
                     $queryParameterString .= '&';
523 523
                 }
524 524
 
525
-                $queryParameterString = '$expand='.$expansionPaths;
525
+                $queryParameterString = '$expand=' . $expansionPaths;
526 526
             }
527 527
 
528 528
             if (!is_null($queryParameterString)) {
@@ -624,7 +624,7 @@  discard block
 block discarded – undo
624 624
         &$parentPathSegments,
625 625
         &$selectionPaths,
626 626
         &$expansionPaths,
627
-        ExpandedProjectionNode &$expandedProjectionNode,
627
+        ExpandedProjectionNode & $expandedProjectionNode,
628 628
         &$foundSelections,
629 629
         &$foundExpansions
630 630
     ) {
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
                         $this->_appendSelectionOrExpandPath(
659 659
                             $selectionPaths,
660 660
                             $parentPathSegments,
661
-                            $childNode->getPropertyName().'/*'
661
+                            $childNode->getPropertyName() . '/*'
662 662
                         );
663 663
                     } else {
664 664
                         $expandedChildrenNeededToBeSelected[] = $childNode;
@@ -702,7 +702,7 @@  discard block
 block discarded – undo
702 702
         }
703 703
 
704 704
         foreach ($parentPathSegments as $parentPathSegment) {
705
-            $path .= $parentPathSegment.'/';
705
+            $path .= $parentPathSegment . '/';
706 706
         }
707 707
 
708 708
         $path .= $segmentToAppend;
Please login to merge, or discard this patch.
src/POData/Writers/Json/JsonLightODataWriter.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             $this->writeFeed($model);
99 99
             $this->_writer->endScope();
100 100
         } elseif ($model instanceof ODataEntry) {
101
-            $this->writeTopLevelMeta($model->resourceSetName.'/@Element');
101
+            $this->writeTopLevelMeta($model->resourceSetName . '/@Element');
102 102
             $this->writeEntry($model);
103 103
         }
104 104
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 
146 146
         $this->_writer
147 147
             ->writeName(ODataConstants::JSON_LIGHT_METADATA_STRING)
148
-            ->writeValue($this->baseUri.'/'.ODataConstants::URI_METADATA_SEGMENT.'#'.$fragment);
148
+            ->writeValue($this->baseUri . '/' . ODataConstants::URI_METADATA_SEGMENT . '#' . $fragment);
149 149
     }
150 150
 
151 151
     protected function writePropertyMeta(ODataProperty $property)
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
             case 'Edm.Decimal':
168 168
             case 'Edm.DateTime':
169 169
                 $this->_writer
170
-                    ->writeName($property->name.ODataConstants::JSON_LIGHT_METADATA_PROPERTY_TYPE_SUFFIX_STRING)
170
+                    ->writeName($property->name . ODataConstants::JSON_LIGHT_METADATA_PROPERTY_TYPE_SUFFIX_STRING)
171 171
                     ->writeValue($property->typeName);
172 172
         }
173 173
 
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
         if ($this->metadataLevel == JsonLightMetadataLevel::FULL()) {
210 210
             //Interestingly the fullmetadata outputs this metadata..even if the thing is expanded
211 211
             $this->_writer
212
-                ->writeName($link->title.ODataConstants::JSON_LIGHT_METADATA_LINK_NAVIGATION_SUFFIX_STRING)
212
+                ->writeName($link->title . ODataConstants::JSON_LIGHT_METADATA_LINK_NAVIGATION_SUFFIX_STRING)
213 213
                 ->writeValue($link->url);
214 214
         }
215 215
 
Please login to merge, or discard this patch.
src/POData/Writers/Metadata/MetadataAssociationTypeSet.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
      */
245 245
     private function _getResourceAssociationSet(ResourceSetWrapper $resourceSet, ResourceType $resourceType, ResourceProperty $navigationProperty)
246 246
     {
247
-        $associationSetLookupKey = $resourceSet->getName().'_'.$resourceType->getFullName().'_'.$navigationProperty->getName();
247
+        $associationSetLookupKey = $resourceSet->getName() . '_' . $resourceType->getFullName() . '_' . $navigationProperty->getName();
248 248
         if (array_key_exists($associationSetLookupKey, $this->_resourceAssociationSets)) {
249 249
             return $this->_resourceAssociationSets[$associationSetLookupKey];
250 250
         }
@@ -283,9 +283,9 @@  discard block
 block discarded – undo
283 283
 
284 284
         $reverseAssociationSetLookupKey = null;
285 285
         if (!is_null($relatedEnd->getResourceProperty())) {
286
-            $reverseAssociationSetLookupKey = $relatedEnd->getResourceSet()->getName().'_'.$relatedEnd->getResourceProperty()->getResourceType()->getFullName().'_'.$relatedEnd->getResourceProperty()->getName();
286
+            $reverseAssociationSetLookupKey = $relatedEnd->getResourceSet()->getName() . '_' . $relatedEnd->getResourceProperty()->getResourceType()->getFullName() . '_' . $relatedEnd->getResourceProperty()->getName();
287 287
         } else {
288
-            $reverseAssociationSetLookupKey = $relatedEnd->getResourceSet()->getName().'_Null_'.$resourceType->getFullName().'_'.$navigationProperty->getName();
288
+            $reverseAssociationSetLookupKey = $relatedEnd->getResourceSet()->getName() . '_Null_' . $resourceType->getFullName() . '_' . $navigationProperty->getName();
289 289
         }
290 290
 
291 291
         if (array_key_exists($reverseAssociationSetLookupKey, $this->_resourceAssociationSets)) {
@@ -324,7 +324,7 @@  discard block
 block discarded – undo
324 324
     {
325 325
         $resourceTypeNamespace = $this->getResourceTypeNamespace($resourceType);
326 326
         $resourceAssociationTypesInNamespace = &$this->getResourceAssociationTypesForNamespace($resourceTypeNamespace);
327
-        $associationTypeLookupKey = $resourceType->getName().'_'.$navigationProperty->getName();
327
+        $associationTypeLookupKey = $resourceType->getName() . '_' . $navigationProperty->getName();
328 328
         if (array_key_exists($associationTypeLookupKey, $resourceAssociationTypesInNamespace)) {
329 329
             return $resourceAssociationTypesInNamespace[$associationTypeLookupKey];
330 330
         }
@@ -334,8 +334,8 @@  discard block
 block discarded – undo
334 334
         $associationTypeEnd1Name = $associationTypeEnd2Name = null;
335 335
         $isBiDirectional = $resourceAssociationSet->isBidirectional();
336 336
         if ($isBiDirectional) {
337
-            $associationTypeEnd1Name = $resourceAssociationSet->getEnd1()->getResourceType()->getName().'_'.$resourceAssociationSet->getEnd1()->getResourceProperty()->getName();
338
-            $associationTypeEnd2Name = $resourceAssociationSet->getEnd2()->getResourceType()->getName().'_'.$resourceAssociationSet->getEnd2()->getResourceProperty()->getName();
337
+            $associationTypeEnd1Name = $resourceAssociationSet->getEnd1()->getResourceType()->getName() . '_' . $resourceAssociationSet->getEnd1()->getResourceProperty()->getName();
338
+            $associationTypeEnd2Name = $resourceAssociationSet->getEnd2()->getResourceType()->getName() . '_' . $resourceAssociationSet->getEnd2()->getResourceProperty()->getName();
339 339
         } else {
340 340
             if (!is_null($resourceAssociationSet->getEnd1()->getResourceProperty())) {
341 341
                 $associationTypeEnd1Name = $resourceAssociationSet->getEnd1()->getResourceType()->getName();
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
         $resourceAssociationTypesInNamespace[$associationTypeLookupKey] = $resourceAssociationType;
371 371
         if ($isBiDirectional) {
372 372
             $relatedAssociationSetEnd = $resourceAssociationSet->getRelatedResourceAssociationSetEnd($resourceSet->getResourceSet(), $resourceType, $navigationProperty);
373
-            $relatedEndLookupKey = $relatedAssociationSetEnd->getResourceType()->getName().'_'.$relatedAssociationSetEnd->getResourceProperty()->getName();
373
+            $relatedEndLookupKey = $relatedAssociationSetEnd->getResourceType()->getName() . '_' . $relatedAssociationSetEnd->getResourceProperty()->getName();
374 374
             $resourceAssociationTypesInNamespace[$relatedEndLookupKey] = $resourceAssociationType;
375 375
         }
376 376
 
@@ -394,10 +394,10 @@  discard block
 block discarded – undo
394 394
                     $resourceAssociationSet->getEnd1() : $resourceAssociationSet->getEnd2();
395 395
         $end2 = $resourceAssociationSet->getRelatedResourceAssociationSetEnd($end1->getResourceSet(), $end1->getResourceType(), $end1->getResourceProperty());
396 396
         //e.g. Customer_Orders (w.r.t Northwind DB)
397
-        $associationTypeName = $end1->getResourceType()->getName().'_'.$end1->getResourceProperty()->getName();
397
+        $associationTypeName = $end1->getResourceType()->getName() . '_' . $end1->getResourceProperty()->getName();
398 398
         if (!is_null($end2->getResourceProperty())) {
399 399
             //Customer_Orders_Order_Customer
400
-            $associationTypeName .= '_'.$end2->getResourceType()->getName().'_'.$end2->getResourceProperty()->getName();
400
+            $associationTypeName .= '_' . $end2->getResourceType()->getName() . '_' . $end2->getResourceProperty()->getName();
401 401
         }
402 402
 
403 403
         return $associationTypeName;
Please login to merge, or discard this patch.
src/POData/Writers/Metadata/MetadataWriter.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         $resourceTypesInContainerNamespace = [];
99 99
         $containerNamespace = $this->providersWrapper->getContainerNamespace();
100 100
         foreach ($this->_metadataManager->getResourceTypesAlongWithNamespace()
101
-                 as $resourceTypeNamespace => $resourceTypesWithName) {
101
+                    as $resourceTypeNamespace => $resourceTypesWithName) {
102 102
             if ($resourceTypeNamespace == $containerNamespace) {
103 103
                 foreach ($resourceTypesWithName as $resourceTypeName => $resourceType) {
104 104
                     $resourceTypesInContainerNamespace[] = $resourceType;
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
     private function _writeProperties(ResourceType $resourceType, $associationTypesInResourceTypeNamespace)
280 280
     {
281 281
         foreach ($this->_metadataManager->getAllVisiblePropertiesDeclaredOnThisType($resourceType)
282
-                 as $resourceProperty) {
282
+                    as $resourceProperty) {
283 283
             if ($resourceProperty->isKindOf(ResourcePropertyKind::BAG)) {
284 284
                 $this->_writeBagProperty($resourceProperty);
285 285
             } elseif ($resourceProperty->isKindOf(ResourcePropertyKind::PRIMITIVE)) {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -366,7 +366,7 @@
 block discarded – undo
366 366
      */
367 367
     private function _writeNavigationProperty(ResourceType $resourceType, $associationTypesInResourceTypeNamespace, ResourceProperty $navigationProperty)
368 368
     {
369
-        $associationTypeLookupName = $resourceType->getName().'_'.$navigationProperty->getName();
369
+        $associationTypeLookupName = $resourceType->getName() . '_' . $navigationProperty->getName();
370 370
         if (!array_key_exists($associationTypeLookupName, $associationTypesInResourceTypeNamespace)) {
371 371
             throw new InvalidOperationException(Messages::metadataWriterNoResourceAssociationSetForNavigationProperty($navigationProperty->getName(), $resourceType->getName()));
372 372
         }
Please login to merge, or discard this patch.
src/POData/Writers/Metadata/MetadataManager.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -212,7 +212,7 @@
 block discarded – undo
212 212
      *                                            edm schema version for the metadata
213 213
      * @param EdmSchemaVersion $edmSchemaVersion
214 214
      */
215
-    public function getDataServiceAndEdmSchemaVersions(Version &$dsVersion, &$edmSchemaVersion)
215
+    public function getDataServiceAndEdmSchemaVersions(Version & $dsVersion, &$edmSchemaVersion)
216 216
     {
217 217
         if ($this->_metadataResourceTypeSet->hasNamedStreams()) {
218 218
             $dsVersion->raiseVersion(3, 0);
Please login to merge, or discard this patch.