Passed
Pull Request — master (#118)
by Christopher
03:25
created
src/POData/UriProcessor/SegmentStack.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
      *
51 51
      * @return bool true if the segment was push, false otherwise
52 52
      */
53
-    public function pushSegment($segmentName, ResourceSetWrapper &$resourceSetWrapper)
53
+    public function pushSegment($segmentName, ResourceSetWrapper & $resourceSetWrapper)
54 54
     {
55 55
         if (!is_string($segmentName)) {
56 56
             throw new InvalidOperationException('segmentName must be a string');
Please login to merge, or discard this patch.
src/POData/Writers/Json/JsonWriter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -158,8 +158,8 @@
 block discarded – undo
158 158
 
159 159
             case 'Edm.DateTime':
160 160
                 $dateTime = new Carbon($value, new \DateTimeZone('UTC'));
161
-                $formattedDateTime = $dateTime->format('U') * 1000;
162
-                $this->_writeCore('/Date('.$formattedDateTime.')/', /* quotes */ true);
161
+                $formattedDateTime = $dateTime->format('U')*1000;
162
+                $this->_writeCore('/Date(' . $formattedDateTime . ')/', /* quotes */ true);
163 163
                 break;
164 164
 
165 165
             case 'Edm.String':
Please login to merge, or discard this patch.
src/POData/Common/Messages/resourceAssociationType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     public static function resourceAssociationTypeEndPropertyMustBeNullOrInstanceofResourceProperty($argumentName)
15 15
     {
16
-        return "The argument '".$argumentName."' must be either null or instance of 'ResourceProperty'.";
16
+        return "The argument '" . $argumentName . "' must be either null or instance of 'ResourceProperty'.";
17 17
     }
18 18
 
19 19
     /**
Please login to merge, or discard this patch.
src/POData/OperationContext/Web/IncomingRequest.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@
 block discarded – undo
132 132
             }
133 133
 
134 134
             $this->rawUrl .= '://' .
135
-                              $_SERVER[HttpProcessUtility::headerToServerKey(ODataConstants::HTTPREQUEST_HEADER_HOST)];
135
+                                $_SERVER[HttpProcessUtility::headerToServerKey(ODataConstants::HTTPREQUEST_HEADER_HOST)];
136 136
             $this->rawUrl .= utf8_decode(urldecode($_SERVER[ODataConstants::HTTPREQUEST_URI]));
137 137
         }
138 138
 
Please login to merge, or discard this patch.
src/POData/Providers/Metadata/ResourceFunctionType.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         $expectedParms = count($baseParms);
124 124
         $actualParms = count($parms);
125 125
         if ($expectedParms != $actualParms) {
126
-            $msg = "Was expecting ". $expectedParms. " arguments, received ".$actualParms." instead";
126
+            $msg = "Was expecting " . $expectedParms . " arguments, received " . $actualParms . " instead";
127 127
             throw new \InvalidArgumentException($msg);
128 128
         }
129 129
 
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     private function checkBlacklist($func, $fromArray = false)
138 138
     {
139 139
         if (in_array($func, $this->blacklist) || in_array(strtolower($func), $this->blacklist)) {
140
-            $msg = (true === $fromArray ? "First element of " : "")."FunctionName blacklisted";
140
+            $msg = (true === $fromArray ? "First element of " : "") . "FunctionName blacklisted";
141 141
             throw new \InvalidArgumentException($msg);
142 142
         }
143 143
     }
Please login to merge, or discard this patch.
src/POData/Providers/Metadata/SimpleMetadataProvider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -295,7 +295,7 @@  discard block
 block discarded – undo
295 295
         $type = null;
296 296
         if ($typeKind == ResourceTypeKind::ENTITY) {
297 297
             list($oet, $entitySet) = $this->metadataManager->addEntityType($name);
298
-            assert($oet instanceof TEntityTypeType, "Entity type ".$name. " not successfully added");
298
+            assert($oet instanceof TEntityTypeType, "Entity type " . $name . " not successfully added");
299 299
             $type = new ResourceEntityType($refClass, $oet, $this);
300 300
             $typeName = $type->getFullName();
301 301
             $returnName = Str::plural($typeName);
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
             );
585 585
         }
586 586
         if (!in_array($resourceMult, $allowedMult)) {
587
-            throw new InvalidOperationException("Supplied multiplicity ".$resourceMult." not valid");
587
+            throw new InvalidOperationException("Supplied multiplicity " . $resourceMult . " not valid");
588 588
         }
589 589
 
590 590
         $resourcePropertyKind = ('*' == $resourceMult)
@@ -852,12 +852,12 @@  discard block
 block discarded – undo
852 852
             throw new \InvalidArgumentException($msg);
853 853
         }
854 854
         if (array_key_exists($name, $this->resourceSets)) {
855
-            $msg = "Resource set with same name, ". $name. ", exists";
855
+            $msg = "Resource set with same name, " . $name . ", exists";
856 856
             throw new \InvalidArgumentException($msg);
857 857
         }
858 858
         $typeName = $returnType->getName();
859 859
         if (!array_key_exists($typeName, $this->OdataEntityMap)) {
860
-            $msg = "Mapping not defined for ".$typeName;
860
+            $msg = "Mapping not defined for " . $typeName;
861 861
             throw new \InvalidArgumentException($msg);
862 862
         }
863 863
         $metaReturn = $this->OdataEntityMap[$typeName];
Please login to merge, or discard this patch.
src/POData/ObjectModel/ObjectModelSerializerBase.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -469,7 +469,7 @@
 block discarded – undo
469 469
                     ODataConstants::HTTPQUERY_STRING_ORDERBY,
470 470
                     ODataConstants::HTTPQUERY_STRING_INLINECOUNT,
471 471
                     ODataConstants::HTTPQUERY_STRING_SELECT
472
-                 ] as $queryOption) {
472
+                    ] as $queryOption) {
473 473
             $value = $this->getService()->getHost()->getQueryStringItem($queryOption);
474 474
             if (!is_null($value)) {
475 475
                 if (!is_null($queryParameterString)) {
Please login to merge, or discard this patch.
src/POData/ObjectModel/IObjectSerialiser.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      *
31 31
      * @return ODataFeed
32 32
      */
33
-    public function writeTopLevelElements(QueryResult &$entryObjects);
33
+    public function writeTopLevelElements(QueryResult & $entryObjects);
34 34
 
35 35
     /**
36 36
      * Write top level url element.
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
      *
61 61
      * @return ODataPropertyContent
62 62
      */
63
-    public function writeTopLevelComplexObject(QueryResult &$complexValue, $propertyName, ResourceType &$resourceType);
63
+    public function writeTopLevelComplexObject(QueryResult & $complexValue, $propertyName, ResourceType & $resourceType);
64 64
 
65 65
     /**
66 66
      * Write top level bag resource.
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
      *
72 72
      * @return ODataPropertyContent
73 73
      */
74
-    public function writeTopLevelBagObject(QueryResult &$BagValue, $propertyName, ResourceType &$resourceType);
74
+    public function writeTopLevelBagObject(QueryResult & $BagValue, $propertyName, ResourceType & $resourceType);
75 75
 
76 76
     /**
77 77
      * Write top level primitive value.
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
      *
82 82
      * @return ODataPropertyContent
83 83
      */
84
-    public function writeTopLevelPrimitive(QueryResult &$primitiveValue, ResourceProperty &$resourceProperty = null);
84
+    public function writeTopLevelPrimitive(QueryResult & $primitiveValue, ResourceProperty & $resourceProperty = null);
85 85
 
86 86
     /**
87 87
      * Gets reference to the request submitted by client.
Please login to merge, or discard this patch.
src/POData/ObjectModel/ObjectModelSerializer.php 2 patches
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
      *
76 76
      * @return ODataFeed
77 77
      */
78
-    public function writeTopLevelElements(QueryResult &$entryObjects)
78
+    public function writeTopLevelElements(QueryResult & $entryObjects)
79 79
     {
80 80
         assert(is_array($entryObjects->results), '!is_array($entryObjects->results)');
81 81
         $requestTargetSource = $this->getRequest()->getTargetSource();
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
      * @return ODataPropertyContent
185 185
      */
186 186
     public function writeTopLevelComplexObject(
187
-        QueryResult &$complexValue,
187
+        QueryResult & $complexValue,
188 188
         $propertyName,
189 189
         ResourceType & $resourceType
190 190
     ) {
@@ -210,9 +210,9 @@  discard block
 block discarded – undo
210 210
      * @return ODataPropertyContent
211 211
      */
212 212
     public function writeTopLevelBagObject(
213
-        QueryResult &$BagValue,
213
+        QueryResult & $BagValue,
214 214
         $propertyName,
215
-        ResourceType &$resourceType
215
+        ResourceType & $resourceType
216 216
     ) {
217 217
         $propertyContent = new ODataPropertyContent();
218 218
         $this->writeBagValue(
@@ -235,8 +235,8 @@  discard block
 block discarded – undo
235 235
      * @return ODataPropertyContent
236 236
      */
237 237
     public function writeTopLevelPrimitive(
238
-        QueryResult &$primitiveValue,
239
-        ResourceProperty &$resourceProperty = null
238
+        QueryResult & $primitiveValue,
239
+        ResourceProperty & $resourceProperty = null
240 240
     ) {
241 241
         assert(null != $resourceProperty, "Resource property must not be null");
242 242
         $propertyContent = new ODataPropertyContent();
@@ -323,11 +323,11 @@  discard block
 block discarded – undo
323 323
      */
324 324
     private function writeFeedElements(
325 325
         &$entryObjects,
326
-        ResourceType &$resourceType,
326
+        ResourceType & $resourceType,
327 327
         $title,
328 328
         $absoluteUri,
329 329
         $relativeUri,
330
-        ODataFeed &$feed,
330
+        ODataFeed & $feed,
331 331
         $needLink = false
332 332
     ) {
333 333
         assert(is_array($entryObjects), '!_writeFeedElements::is_array($entryObjects)');
@@ -378,11 +378,11 @@  discard block
 block discarded – undo
378 378
      */
379 379
     private function writeObjectProperties(
380 380
         $customObject,
381
-        ResourceType &$resourceType,
381
+        ResourceType & $resourceType,
382 382
         $absoluteUri,
383 383
         $relativeUri,
384 384
         &$odataEntry,
385
-        ODataPropertyContent &$odataPropertyContent
385
+        ODataPropertyContent & $odataPropertyContent
386 386
     ) {
387 387
         $resourceTypeKind = $resourceType->getResourceTypeKind();
388 388
         if (is_null($absoluteUri) == (ResourceTypeKind::ENTITY == $resourceTypeKind)
@@ -505,8 +505,8 @@  discard block
 block discarded – undo
505 505
      */
506 506
     private function writePrimitiveValue(
507 507
         &$primitiveValue,
508
-        ODataProperty &$odataProperty,
509
-        ResourceProperty &$resourceProperty
508
+        ODataProperty & $odataProperty,
509
+        ResourceProperty & $resourceProperty
510 510
     ) {
511 511
         if (is_object($primitiveValue)) {
512 512
             //TODO ERROR: The property 'PropertyName'
@@ -540,9 +540,9 @@  discard block
 block discarded – undo
540 540
     private function writeComplexValue(
541 541
         &$complexValue,
542 542
         $propertyName,
543
-        ResourceType &$resourceType,
543
+        ResourceType & $resourceType,
544 544
         $relativeUri,
545
-        ODataPropertyContent &$odataPropertyContent
545
+        ODataPropertyContent & $odataPropertyContent
546 546
     ) {
547 547
         $odataProperty = new ODataProperty();
548 548
         $odataProperty->name = $propertyName;
@@ -581,9 +581,9 @@  discard block
 block discarded – undo
581 581
     private function writeBagValue(
582 582
         &$BagValue,
583 583
         $propertyName,
584
-        ResourceType &$resourceType,
584
+        ResourceType & $resourceType,
585 585
         $relativeUri,
586
-        ODataPropertyContent &$odataPropertyContent
586
+        ODataPropertyContent & $odataPropertyContent
587 587
     ) {
588 588
         assert(null == $BagValue || is_array($BagValue), 'Bag parameter must be null or array');
589 589
         $bagItemResourceTypeKind = $resourceType->getResourceTypeKind();
@@ -640,10 +640,10 @@  discard block
 block discarded – undo
640 640
      */
641 641
     private function writeMediaResourceMetadata(
642 642
         $entryObject,
643
-        ResourceType &$resourceType,
643
+        ResourceType & $resourceType,
644 644
         $title,
645 645
         $relativeUri,
646
-        ODataEntry &$odataEntry
646
+        ODataEntry & $odataEntry
647 647
     ) {
648 648
         $streamProviderWrapper = $this->getService()->getStreamProviderWrapper();
649 649
         assert(null != $streamProviderWrapper, "Retrieved stream provider must not be null");
@@ -716,7 +716,7 @@  discard block
 block discarded – undo
716 716
      * @return string
717 717
      */
718 718
     private function primitiveToString(
719
-        ResourceType &$primitiveResourceType,
719
+        ResourceType & $primitiveResourceType,
720 720
         $primitiveValue
721 721
     ) {
722 722
         $type = $primitiveResourceType->getInstanceType();
@@ -755,9 +755,9 @@  discard block
 block discarded – undo
755 755
     private function complexObjectToContent(
756 756
         &$complexValue,
757 757
         $propertyName,
758
-        ResourceType &$resourceType,
758
+        ResourceType & $resourceType,
759 759
         $relativeUri,
760
-        ODataPropertyContent &$odataPropertyContent
760
+        ODataPropertyContent & $odataPropertyContent
761 761
     ) {
762 762
         $count = count($this->complexTypeInstanceCollection);
763 763
         for ($i = 0; $i < $count; ++$i) {
@@ -800,9 +800,9 @@  discard block
 block discarded – undo
800 800
      */
801 801
     private function writeObjectPropertiesUnexpanded(
802 802
         $customObject,
803
-        ResourceType &$resourceType,
803
+        ResourceType & $resourceType,
804 804
         $relativeUri,
805
-        ODataPropertyContent &$odataPropertyContent,
805
+        ODataPropertyContent & $odataPropertyContent,
806 806
         $resourceTypeKind,
807 807
         $navigationProperties
808 808
     ) {
@@ -901,7 +901,7 @@  discard block
 block discarded – undo
901 901
         if (28 < $resourceKind) {
902 902
             return false;
903 903
         }
904
-        return 0 == ($resourceKind % 4);
904
+        return 0 == ($resourceKind%4);
905 905
     }
906 906
 
907 907
 
@@ -919,9 +919,9 @@  discard block
 block discarded – undo
919 919
      */
920 920
     private function writeObjectPropertiesExpanded(
921 921
         $customObject,
922
-        ResourceType &$resourceType,
922
+        ResourceType & $resourceType,
923 923
         $relativeUri,
924
-        ODataPropertyContent &$odataPropertyContent,
924
+        ODataPropertyContent & $odataPropertyContent,
925 925
         $projectionNodes,
926 926
         $navigationProperties
927 927
     ) {
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -430,7 +430,8 @@
 block discarded – undo
430 430
                 $resourceTypeKind,
431 431
                 $navigationProperties
432 432
             );
433
-        } else { //This is the code path to handle projected properties of Entry
433
+        } else {
434
+//This is the code path to handle projected properties of Entry
434 435
             list($odataPropertyContent, $navigationProperties) = $this->writeObjectPropertiesExpanded(
435 436
                 $customObject,
436 437
                 $resourceType,
Please login to merge, or discard this patch.