Passed
Pull Request — master (#215)
by
unknown
12:29
created
src/POData/OperationContext/Web/IncomingRequest.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -131,7 +131,7 @@
 block discarded – undo
131 131
             }
132 132
 
133 133
             $this->rawUrl .= '://' .
134
-                             $_SERVER[HttpProcessUtility::headerToServerKey(ODataConstants::HTTPREQUEST_HEADER_HOST)];
134
+                                $_SERVER[HttpProcessUtility::headerToServerKey(ODataConstants::HTTPREQUEST_HEADER_HOST)];
135 135
             $this->rawUrl .= utf8_decode(urldecode($_SERVER[ODataConstants::HTTPREQUEST_URI]));
136 136
         }
137 137
 
Please login to merge, or discard this patch.
src/POData/Common/Messages/resourceProperty.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     public static function resourcePropertyInvalidKindParameter($argumentName)
15 15
     {
16 16
         return 'The argument \''.$argumentName.'\' is not a valid ResourcePropertyKind enum value or'
17
-               .' valid combination of ResourcePropertyKind enum values';
17
+                .' valid combination of ResourcePropertyKind enum values';
18 18
     }
19 19
 
20 20
     /**
@@ -30,6 +30,6 @@  discard block
 block discarded – undo
30 30
         $resourceTypeArgName
31 31
     ) {
32 32
         return 'The \''.$resourcePropertyKindArgName.'\' parameter does not match with the type of the resource'
33
-               .' type in parameter \''.$resourceTypeArgName.'\'';
33
+                .' type in parameter \''.$resourceTypeArgName.'\'';
34 34
     }
35 35
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
      */
14 14
     public static function resourcePropertyInvalidKindParameter($argumentName)
15 15
     {
16
-        return 'The argument \''.$argumentName.'\' is not a valid ResourcePropertyKind enum value or'
16
+        return 'The argument \'' . $argumentName . '\' is not a valid ResourcePropertyKind enum value or'
17 17
                .' valid combination of ResourcePropertyKind enum values';
18 18
     }
19 19
 
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
         $resourcePropertyKindArgName,
30 30
         $resourceTypeArgName
31 31
     ) {
32
-        return 'The \''.$resourcePropertyKindArgName.'\' parameter does not match with the type of the resource'
33
-               .' type in parameter \''.$resourceTypeArgName.'\'';
32
+        return 'The \'' . $resourcePropertyKindArgName . '\' parameter does not match with the type of the resource'
33
+               .' type in parameter \'' . $resourceTypeArgName . '\'';
34 34
     }
35 35
 }
Please login to merge, or discard this patch.
src/POData/Common/Messages/skipTokenParser.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
         $expectedCount
45 45
     ) {
46 46
         return 'The number of keys \'' . $skipTokenValuesCount . '\' in skip token with value \'' . $skipToken .
47
-               '\' did not match the number of ordering constraints \'' . $expectedCount . '\' for the resource type.';
47
+                '\' did not match the number of ordering constraints \'' . $expectedCount . '\' for the resource type.';
48 48
     }
49 49
 
50 50
     /**
Please login to merge, or discard this patch.
src/POData/Common/Messages/request.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
     public static function requestVersionTooLow($requestedVersion, $requiredVersion)
18 18
     {
19 19
         return 'Request version \''.$requestedVersion.'\' is not supported for the request payload. The only'
20
-               .' supported version is \''.$requiredVersion.'\'.';
20
+                .' supported version is \''.$requiredVersion.'\'.';
21 21
     }
22 22
 
23 23
     /**
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
     public static function requestVersionIsBiggerThanProtocolVersion($requiredVersion, $configuredVersion)
33 33
     {
34 34
         return 'The response requires that version '.$requiredVersion.' of the protocol be used, but the'
35
-               .' MaxProtocolVersion of the data service is set to '.$configuredVersion.'.';
35
+                .' MaxProtocolVersion of the data service is set to '.$configuredVersion.'.';
36 36
     }
37 37
 
38 38
     /**
@@ -65,6 +65,6 @@  discard block
 block discarded – undo
65 65
         $availableVersions
66 66
     ) {
67 67
         return 'The version value '.$requestedVersion.' in the header '.$requestHeaderName.' is not'
68
-               .' supported, available versions are '.$availableVersions;
68
+                .' supported, available versions are '.$availableVersions;
69 69
     }
70 70
 }
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
      */
17 17
     public static function requestVersionTooLow($requestedVersion, $requiredVersion)
18 18
     {
19
-        return 'Request version \''.$requestedVersion.'\' is not supported for the request payload. The only'
20
-               .' supported version is \''.$requiredVersion.'\'.';
19
+        return 'Request version \'' . $requestedVersion . '\' is not supported for the request payload. The only'
20
+               .' supported version is \'' . $requiredVersion . '\'.';
21 21
     }
22 22
 
23 23
     /**
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
      */
32 32
     public static function requestVersionIsBiggerThanProtocolVersion($requiredVersion, $configuredVersion)
33 33
     {
34
-        return 'The response requires that version '.$requiredVersion.' of the protocol be used, but the'
35
-               .' MaxProtocolVersion of the data service is set to '.$configuredVersion.'.';
34
+        return 'The response requires that version ' . $requiredVersion . ' of the protocol be used, but the'
35
+               .' MaxProtocolVersion of the data service is set to ' . $configuredVersion . '.';
36 36
     }
37 37
 
38 38
     /**
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
      */
47 47
     public static function requestDescriptionInvalidVersionHeader($versionAsString, $headerName)
48 48
     {
49
-        return 'The header '.$headerName.' has malformed version value '.$versionAsString;
49
+        return 'The header ' . $headerName . ' has malformed version value ' . $versionAsString;
50 50
     }
51 51
 
52 52
     /**
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         $requestedVersion,
65 65
         $availableVersions
66 66
     ) {
67
-        return 'The version value '.$requestedVersion.' in the header '.$requestHeaderName.' is not'
68
-               .' supported, available versions are '.$availableVersions;
67
+        return 'The version value ' . $requestedVersion . ' in the header ' . $requestHeaderName . ' is not'
68
+               .' supported, available versions are ' . $availableVersions;
69 69
     }
70 70
 }
Please login to merge, or discard this patch.
src/POData/Common/Messages/orderByInfo.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     public static function orderByParserPropertyNotFound($resourceTypeName, $propertyName)
51 51
     {
52 52
         return 'Error in the \'orderby\' clause. Type ' . $resourceTypeName
53
-               . ' does not have a property named \'' . $propertyName . '\'.';
53
+                . ' does not have a property named \'' . $propertyName . '\'.';
54 54
     }
55 55
 
56 56
     /**
@@ -179,6 +179,6 @@  discard block
 block discarded – undo
179 179
     public static function orderByParserFailedToAccessOrInitializeProperty($propertyName, $parentObjectName)
180 180
     {
181 181
         return 'OrderBy parser failed to access or initialize the property ' . $propertyName .
182
-               ' of ' . $parentObjectName;
182
+                ' of ' . $parentObjectName;
183 183
     }
184 184
 }
Please login to merge, or discard this patch.
src/POData/OperationContext/ServiceHost.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
                     );
223 223
                 }
224 224
 
225
-                $builtServiceUri = $requestUriScheme .'://' . $this->getAbsoluteRequestUri()->getHost();
225
+                $builtServiceUri = $requestUriScheme . '://' . $this->getAbsoluteRequestUri()->getHost();
226 226
 
227 227
                 if (($requestUriScheme == 'http' && $requestUriPort != '80') ||
228 228
                     ($requestUriScheme == 'https' && $requestUriPort != '443')
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
             $this->getOperationContext()->outgoingResponse()->setContentLength($value);
512 512
         } else {
513 513
             throw ODataException::notAcceptableError(
514
-                'ContentLength: '.$value.' is invalid'
514
+                'ContentLength: ' . $value . ' is invalid'
515 515
             );
516 516
         }
517 517
     }
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
     public function setResponseStatusCode($value)
557 557
     {
558 558
         if (!is_numeric($value)) {
559
-            $msg = 'Invalid, non-numeric, status code: '.$value;
559
+            $msg = 'Invalid, non-numeric, status code: ' . $value;
560 560
             throw ODataException::createInternalServerError($msg);
561 561
         }
562 562
         $floor = floor($value/100);
Please login to merge, or discard this patch.
src/POData/ObjectModel/CynicSerialiser.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -565,10 +565,10 @@
 block discarded – undo
565 565
     {
566 566
         $queryParameterString = null;
567 567
         foreach ([ODataConstants::HTTPQUERY_STRING_FILTER,
568
-                     ODataConstants::HTTPQUERY_STRING_EXPAND,
569
-                     ODataConstants::HTTPQUERY_STRING_ORDERBY,
570
-                     ODataConstants::HTTPQUERY_STRING_INLINECOUNT,
571
-                     ODataConstants::HTTPQUERY_STRING_SELECT, ] as $queryOption) {
568
+                        ODataConstants::HTTPQUERY_STRING_EXPAND,
569
+                        ODataConstants::HTTPQUERY_STRING_ORDERBY,
570
+                        ODataConstants::HTTPQUERY_STRING_INLINECOUNT,
571
+                        ODataConstants::HTTPQUERY_STRING_SELECT, ] as $queryOption) {
572 572
             $value = $this->getService()->getHost()->getQueryStringItem($queryOption);
573 573
             if (null !== $value) {
574 574
                 if (null !== $queryParameterString) {
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
         $this->service = $service;
104 104
         $this->request = $request;
105 105
         $this->absoluteServiceUri = $service->getHost()->getAbsoluteServiceUri()->getUrlAsString();
106
-        $this->absoluteServiceUriWithSlash = rtrim($this->absoluteServiceUri, '/').'/';
106
+        $this->absoluteServiceUriWithSlash = rtrim($this->absoluteServiceUri, '/') . '/';
107 107
         $this->stack = new SegmentStack($request);
108 108
         $this->complexTypeInstanceCollection = [];
109 109
         $this->updated = Carbon::now();
@@ -153,8 +153,8 @@  discard block
 block discarded – undo
153 153
         $nonRelCount = count($nonRelProp);
154 154
         assert(
155 155
             $rawCount == $relCount + $nonRelCount,
156
-            'Raw property count '.$rawCount.', does not equal sum of relProp count, '.$relCount
157
-            .', and nonRelPropCount,'.$nonRelCount
156
+            'Raw property count ' . $rawCount . ', does not equal sum of relProp count, ' . $relCount
157
+            .', and nonRelPropCount,' . $nonRelCount
158 158
         );
159 159
 
160 160
         // now mask off against projNodes
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
             $resourceType,
179 179
             $resourceSet->getName()
180 180
         );
181
-        $absoluteUri = rtrim($this->absoluteServiceUri, '/').'/'.$relativeUri;
181
+        $absoluteUri = rtrim($this->absoluteServiceUri, '/') . '/' . $relativeUri;
182 182
 
183 183
         list($mediaLink, $mediaLinks) = $this->writeMediaData(
184 184
             $entryObject->results,
@@ -202,11 +202,11 @@  discard block
 block discarded – undo
202 202
             );
203 203
             $propTail = ResourcePropertyKind::RESOURCE_REFERENCE == $propKind ? 'entry' : 'feed';
204 204
             $nuLink->isCollection = 'feed' === $propTail;
205
-            $propType = 'application/atom+xml;type='.$propTail;
205
+            $propType = 'application/atom+xml;type=' . $propTail;
206 206
             $propName = $prop->getName();
207 207
             $nuLink->title = $propName;
208
-            $nuLink->name = ODataConstants::ODATA_RELATED_NAMESPACE.$propName;
209
-            $nuLink->url = $relativeUri.'/'.$propName;
208
+            $nuLink->name = ODataConstants::ODATA_RELATED_NAMESPACE . $propName;
209
+            $nuLink->url = $relativeUri . '/' . $propName;
210 210
             $nuLink->type = $propType;
211 211
 
212 212
             $shouldExpand = $this->shouldExpandSegment($propName);
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
         $newCount = count($this->lightStack);
242 242
         assert(
243 243
             $newCount == $stackCount,
244
-            'Should have '.$stackCount.'elements in stack, have '.$newCount.'elements'
244
+            'Should have ' . $stackCount . 'elements in stack, have ' . $newCount . 'elements'
245 245
         );
246 246
         --$this->lightStack[$newCount - 1]['count'];
247 247
         if (0 == $this->lightStack[$newCount - 1]['count']) {
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
             $segment = $this->getNextLinkUri($lastObject);
317 317
             $nextLink = new ODataLink();
318 318
             $nextLink->name = ODataConstants::ATOM_LINK_NEXT_ATTRIBUTE_STRING;
319
-            $nextLink->url = rtrim($this->absoluteServiceUri, '/').'/'.$stackSegment.$segment;
319
+            $nextLink->url = rtrim($this->absoluteServiceUri, '/') . '/' . $stackSegment . $segment;
320 320
             $odata->nextPageLink = $nextLink;
321 321
         }
322 322
 
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
                 $this->getCurrentResourceSetWrapper()->getName()
342 342
             );
343 343
 
344
-            $url->url = rtrim($this->absoluteServiceUri, '/').'/'.$relativeUri;
344
+            $url->url = rtrim($this->absoluteServiceUri, '/') . '/' . $relativeUri;
345 345
         }
346 346
 
347 347
         return $url;
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
                 $segment = $this->getNextLinkUri($lastObject);
378 378
                 $nextLink = new ODataLink();
379 379
                 $nextLink->name = ODataConstants::ATOM_LINK_NEXT_ATTRIBUTE_STRING;
380
-                $nextLink->url = rtrim($this->absoluteServiceUri, '/').'/'.$stackSegment.$segment;
380
+                $nextLink->url = rtrim($this->absoluteServiceUri, '/') . '/' . $stackSegment . $segment;
381 381
                 $nextLink->url = ltrim($nextLink->url, '/');
382 382
                 $urls->nextPageLink = $nextLink;
383 383
             }
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
         $propertyContent = new ODataPropertyContent();
437 437
         $odataProperty = new ODataProperty();
438 438
         $odataProperty->name = $propertyName;
439
-        $odataProperty->typeName = 'Collection('.$resourceType->getFullName().')';
439
+        $odataProperty->typeName = 'Collection(' . $resourceType->getFullName() . ')';
440 440
         $odataProperty->value = $this->writeBagValue($resourceType, $result);
441 441
 
442 442
         $propertyContent->properties[$propertyName] = $odataProperty;
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
     {
522 522
         $this->service = $service;
523 523
         $this->absoluteServiceUri = $service->getHost()->getAbsoluteServiceUri()->getUrlAsString();
524
-        $this->absoluteServiceUriWithSlash = rtrim($this->absoluteServiceUri, '/').'/';
524
+        $this->absoluteServiceUriWithSlash = rtrim($this->absoluteServiceUri, '/') . '/';
525 525
     }
526 526
 
527 527
     /**
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
         $typeName = $resourceType->getName();
672 672
         $keyProperties = $resourceType->getKeyProperties();
673 673
         assert(0 != count($keyProperties), 'count($keyProperties) == 0');
674
-        $keyString = $containerName.'(';
674
+        $keyString = $containerName . '(';
675 675
         $comma = null;
676 676
         foreach ($keyProperties as $keyName => $resourceProperty) {
677 677
             $keyType = $resourceProperty->getInstanceType();
@@ -684,7 +684,7 @@  discard block
 block discarded – undo
684 684
             }
685 685
 
686 686
             $keyValue = $keyType->convertToOData($keyValue);
687
-            $keyString .= $comma.$keyName.'='.$keyValue;
687
+            $keyString .= $comma . $keyName . '=' . $keyValue;
688 688
             $comma = ',';
689 689
         }
690 690
 
@@ -753,7 +753,7 @@  discard block
 block discarded – undo
753 753
         $skipToken = $internalOrderByInfo->buildSkipTokenValue($lastObject);
754 754
         assert(null !== $skipToken, '!is_null($skipToken)');
755 755
         $token = (1 < $numSegments) ? '$skiptoken=' : '$skip=';
756
-        $skipToken = '?'.$queryParameterString.$token.$skipToken;
756
+        $skipToken = '?' . $queryParameterString . $token . $skipToken;
757 757
 
758 758
         return $skipToken;
759 759
     }
@@ -775,7 +775,7 @@  discard block
 block discarded – undo
775 775
         $mediaLink = null;
776 776
         if ($resourceType->isMediaLinkEntry()) {
777 777
             $eTag = $streamProviderWrapper->getStreamETag2($entryObject, null, $context);
778
-            $mediaLink = new ODataMediaLink($type, '/$value', $relativeUri.'/$value', '*/*', $eTag, 'edit-media');
778
+            $mediaLink = new ODataMediaLink($type, '/$value', $relativeUri . '/$value', '*/*', $eTag, 'edit-media');
779 779
         }
780 780
         $mediaLinks = [];
781 781
         if ($resourceType->hasNamedStream()) {
@@ -856,7 +856,7 @@  discard block
 block discarded – undo
856 856
             $nuLink->expandedResult->selfLink->title = $propName;
857 857
             $nuLink->expandedResult->selfLink->url = $nuLink->url;
858 858
             $nuLink->expandedResult->title = new ODataTitle($propName);
859
-            $nuLink->expandedResult->id = rtrim($this->absoluteServiceUri, '/').'/'.$nuLink->url;
859
+            $nuLink->expandedResult->id = rtrim($this->absoluteServiceUri, '/') . '/' . $nuLink->url;
860 860
         }
861 861
     }
862 862
 
@@ -937,10 +937,10 @@  discard block
 block discarded – undo
937 937
             $value = $this->getService()->getHost()->getQueryStringItem($queryOption);
938 938
             if (null !== $value) {
939 939
                 if (null !== $queryParameterString) {
940
-                    $queryParameterString = $queryParameterString.'&';
940
+                    $queryParameterString = $queryParameterString . '&';
941 941
                 }
942 942
 
943
-                $queryParameterString .= $queryOption.'='.$value;
943
+                $queryParameterString .= $queryOption . '=' . $value;
944 944
             }
945 945
         }
946 946
 
@@ -952,7 +952,7 @@  discard block
 block discarded – undo
952 952
                     $queryParameterString .= '&';
953 953
                 }
954 954
 
955
-                $queryParameterString .= ODataConstants::HTTPQUERY_STRING_TOP.'='.$remainingCount;
955
+                $queryParameterString .= ODataConstants::HTTPQUERY_STRING_TOP . '=' . $remainingCount;
956 956
             }
957 957
         }
958 958
 
@@ -984,7 +984,7 @@  discard block
 block discarded – undo
984 984
             $nonNull = null !== $result;
985 985
             $subProp = new ODataProperty();
986 986
             $subProp->name = strval($corn);
987
-            $subProp->typeName = $typePrepend.$resource->getFullName().$typeAppend;
987
+            $subProp->typeName = $typePrepend . $resource->getFullName() . $typeAppend;
988 988
 
989 989
             if ($nonNull && is_array($result)) {
990 990
                 $subProp->value = $this->writeBagValue($resource, $result);
@@ -1047,6 +1047,6 @@  discard block
 block discarded – undo
1047 1047
             return false;
1048 1048
         }
1049 1049
 
1050
-        return 0 == ($resourceKind % 4);
1050
+        return 0 == ($resourceKind%4);
1051 1051
     }
1052 1052
 }
Please login to merge, or discard this patch.
src/POData/ObjectModel/ODataMediaLink.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,6 +76,6 @@
 block discarded – undo
76 76
         $this->eTag = $eTag;
77 77
         $this->name = $name;
78 78
         $this->srcLink = $srcLink;
79
-        $this->rel = (null !== $rel) ? $rel : self::MEDIARESOURCE_BASE.$name;
79
+        $this->rel = (null !== $rel) ? $rel : self::MEDIARESOURCE_BASE . $name;
80 80
     }
81 81
 }
Please login to merge, or discard this patch.
src/POData/ObjectModel/ModelDeserialiser.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
 
35 35
         $payloadType = $payload->type->term;
36 36
         $pay = explode('.', $payloadType);
37
-        $payloadType = $pay[count($pay)-1];
37
+        $payloadType = $pay[count($pay) - 1];
38 38
         $actualType = $entityType->getName();
39 39
 
40 40
         if ($payloadType !== $actualType) {
Please login to merge, or discard this patch.