Completed
Pull Request — master (#267)
by Alex
08:55
created
src/POData/HttpProcessUtility.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -414,7 +414,7 @@
 block discarded – undo
414 414
 
415 415
         $textLen = strlen($text);
416 416
         if ($textIndex >= $textLen || '.' != $text[$textIndex]) {
417
-            return $qualityValue * 1000;
417
+            return $qualityValue*1000;
418 418
         }
419 419
 
420 420
         ++$textIndex;
Please login to merge, or discard this patch.
src/POData/Providers/Metadata/Type/Binary.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@
 block discarded – undo
102 102
     public static function validateWithoutPrefix(string $value, &$outValue)
103 103
     {
104 104
         $length = strlen($value);
105
-        if (0 == $length || 0 != $length % 2) {
105
+        if (0 == $length || 0 != $length%2) {
106 106
             return false;
107 107
         }
108 108
 
Please login to merge, or discard this patch.
src/POData/Providers/Metadata/ResourceAssociationSet.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@
 block discarded – undo
66 66
         $type1 = $end1->getResourceType();
67 67
         $type2 = $end2->getResourceType();
68 68
 
69
-        if ($type1 === $type2  && $prop1 === $prop2) {
69
+        if ($type1 === $type2 && $prop1 === $prop2) {
70 70
             throw new InvalidArgumentException(
71 71
                 Messages::resourceAssociationSetSelfReferencingAssociationCannotBeBiDirectional()
72 72
             );
Please login to merge, or discard this patch.
src/POData/Readers/Atom/Processors/Entry/PropertyProcessor.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
         assert($tagNamespace === ODataConstants::ODATA_NAMESPACE ||
51 51
             $tagNamespace === ODataConstants::ODATA_METADATA_NAMESPACE);
52 52
 
53
-        $property           = new ODataProperty(
53
+        $property = new ODataProperty(
54 54
             $tagName,
55 55
             $this->arrayKeyOrDefault(
56 56
                 $attributes,
Please login to merge, or discard this patch.
POData/UriProcessor/ResourcePathProcessor/SegmentParser/KeyDescriptor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -590,13 +590,13 @@
 block discarded – undo
590 590
         foreach ($values as $propName => $propDeets) {
591 591
             assert(2 == count($propDeets));
592 592
             assert($propDeets[1] instanceof IType);
593
-            $property           = new ODataProperty(
593
+            $property = new ODataProperty(
594 594
                 strval($propName),
595 595
                 $propDeets[1]->getFullTypeName(),
596 596
                 $propDeets[1]->convert($propDeets[0])
597 597
 
598 598
             );
599
-            $result[$propName]  = $property;
599
+            $result[$propName] = $property;
600 600
         }
601 601
 
602 602
         return $result;
Please login to merge, or discard this patch.
src/POData/Readers/Atom/Processors/FeedProcessor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             ODataConstants::ATOM_LINK_RELATION_ATTRIBUTE_NAME,
85 85
             ''
86 86
         );
87
-        $prop                     = $rel === ODataConstants::ATOM_SELF_RELATION_ATTRIBUTE_VALUE ? 'setSelfLink' : 'setNextPageLink';
87
+        $prop = $rel === ODataConstants::ATOM_SELF_RELATION_ATTRIBUTE_VALUE ? 'setSelfLink' : 'setNextPageLink';
88 88
         $this->oDataFeed->{$prop}(new ODataLink(
89 89
             $this->arrayKeyOrDefault($attributes, ODataConstants::ATOM_LINK_RELATION_ATTRIBUTE_NAME, ''),
90 90
             $this->arrayKeyOrDefault($attributes, ODataConstants::ATOM_TITLE_ELELMET_NAME, ''),
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     public function handleStartMetadataCount()
98 98
     {
99 99
         $this->enqueueEnd(function () {
100
-            $this->oDataFeed->setRowCount((int)$this->popCharData());
100
+            $this->oDataFeed->setRowCount((int) $this->popCharData());
101 101
         });
102 102
     }
103 103
 
Please login to merge, or discard this patch.
src/POData/ObjectModel/ODataProperty.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -76,7 +76,7 @@
 block discarded – undo
76 76
      */
77 77
     public function getTypeName(): string
78 78
     {
79
-        return $this->typeName ?? '' ;
79
+        return $this->typeName ?? '';
80 80
     }
81 81
 
82 82
     /**
Please login to merge, or discard this patch.
src/POData/ObjectModel/CynicSerialiser.php 1 patch
Spacing   +7 added lines, -8 removed lines patch added patch discarded remove patch
@@ -153,8 +153,7 @@  discard block
 block discarded – undo
153 153
         $nextLink            = null;
154 154
 
155 155
         $rowCount = $this->getRequest()->queryType == QueryType::ENTITIES_WITH_COUNT() ?
156
-            $this->getRequest()->getCountValue() :
157
-            null;
156
+            $this->getRequest()->getCountValue() : null;
158 157
         foreach ($res as $entry) {
159 158
             $query     = $entry instanceof QueryResult ? $entry : new QueryResult($entry);
160 159
             $entries[] = $this->writeTopLevelElement($query);
@@ -287,7 +286,7 @@  discard block
 block discarded – undo
287 286
 
288 287
         $resourceSet = $resourceType->getCustomState();
289 288
         assert($resourceSet instanceof ResourceSet);
290
-        $type  = $resourceType->getFullName();
289
+        $type = $resourceType->getFullName();
291 290
 
292 291
         $relativeUri = $this->getEntryInstanceKey(
293 292
             $entryObject->results,
@@ -339,7 +338,7 @@  discard block
 block discarded – undo
339 338
             $links[] = $nuLink;
340 339
         }
341 340
 
342
-        $odata                   = new ODataEntry(
341
+        $odata = new ODataEntry(
343 342
             $absoluteUri,
344 343
             null,
345 344
             new ODataTitle($resourceType->getName()),
@@ -736,7 +735,7 @@  discard block
 block discarded – undo
736 735
             return false;
737 736
         }
738 737
 
739
-        return 0 == ($value % 4);
738
+        return 0 == ($value%4);
740 739
     }
741 740
 
742 741
     /**
@@ -819,7 +818,7 @@  discard block
 block discarded – undo
819 818
             $nuLink->getExpandedResult()->getData()->getSelfLink()->setTitle($propName);
820 819
             $nuLink->getExpandedResult()->getData()->getSelfLink()->setUrl($nuLink->getUrl());
821 820
             $nuLink->getExpandedResult()->getData()->setTitle(new ODataTitle($propName));
822
-            $nuLink->getExpandedResult()->getData()->id              = rtrim($this->absoluteServiceUri, '/') . '/' . $nuLink->getUrl();
821
+            $nuLink->getExpandedResult()->getData()->id = rtrim($this->absoluteServiceUri, '/') . '/' . $nuLink->getUrl();
823 822
         }
824 823
     }
825 824
 
@@ -867,7 +866,7 @@  discard block
 block discarded – undo
867 866
             ODataConstants::HTTPQUERY_STRING_EXPAND,
868 867
             ODataConstants::HTTPQUERY_STRING_ORDERBY,
869 868
             ODataConstants::HTTPQUERY_STRING_INLINECOUNT,
870
-            ODataConstants::HTTPQUERY_STRING_SELECT,] as $queryOption) {
869
+            ODataConstants::HTTPQUERY_STRING_SELECT, ] as $queryOption) {
871 870
             $value = $this->getService()->getHost()->getQueryStringItem($queryOption);
872 871
             if (null !== $value) {
873 872
                 if (null !== $queryParameterString) {
@@ -1037,7 +1036,7 @@  discard block
 block discarded – undo
1037 1036
     {
1038 1037
         $result = $bagValue->results;
1039 1038
 
1040
-        $odataProperty           = new ODataProperty(
1039
+        $odataProperty = new ODataProperty(
1041 1040
             $propertyName,
1042 1041
             'Collection(' . $resourceType->getFullName() . ')',
1043 1042
             $this->writeBagValue($resourceType, $result)
Please login to merge, or discard this patch.
src/POData/BaseService.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -538,7 +538,7 @@  discard block
 block discarded – undo
538 538
 
539 539
                         // Resource is not modified so set status code
540 540
                         // to 304 => 'Not Modified'
541
-                        $status = $needToSerializeResponse ? HttpStatus::CODE_NOCONTENT : HttpStatus::CODE_NOT_MODIFIED ;
541
+                        $status = $needToSerializeResponse ? HttpStatus::CODE_NOCONTENT : HttpStatus::CODE_NOT_MODIFIED;
542 542
 
543 543
                         $this->getHost()->setResponseStatusCode($status);
544 544
                         $hasResponseBody = false;
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
                     }
551 551
                 } elseif ($requestTargetKind->isCOMPLEX_OBJECT() ||
552 552
                     $requestTargetKind->isBAG()) {
553
-                    if ( null === $requestProperty) {
553
+                    if (null === $requestProperty) {
554 554
                         throw new InvalidOperationException('Projected request property cannot be null');
555 555
                     }
556 556
 
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
                         $requestProperty->getName(),
561 561
                         $targetResourceType
562 562
                     );
563
-                } elseif ($requestTargetKind->isPRIMITIVE()){
563
+                } elseif ($requestTargetKind->isPRIMITIVE()) {
564 564
                     $odataModelInstance = $objectModelSerializer->writeTopLevelPrimitive(
565 565
                         $result,
566 566
                         $requestProperty
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
             MimeTypes::MIME_APPLICATION_JSON_FULL_META,
619 619
             MimeTypes::MIME_APPLICATION_JSON_NO_META,
620 620
             MimeTypes::MIME_APPLICATION_JSON_MINIMAL_META,
621
-            MimeTypes::MIME_APPLICATION_JSON_VERBOSE,];
621
+            MimeTypes::MIME_APPLICATION_JSON_VERBOSE, ];
622 622
 
623 623
         // The Accept request-header field specifies media types which are acceptable for the response
624 624
 
@@ -646,15 +646,15 @@  discard block
 block discarded – undo
646 646
         $availableMimeTypesByTarget = [
647 647
             TargetKind::METADATA()->getValue()          => [MimeTypes::MIME_APPLICATION_XML],
648 648
             TargetKind::SERVICE_DIRECTORY()->getValue() => array_merge([MimeTypes::MIME_APPLICATION_ATOMSERVICE], $baseMimeTypes),
649
-            TargetKind::PRIMITIVE()->getValue()              => array_merge([MimeTypes::MIME_APPLICATION_XML, MimeTypes::MIME_TEXTXML,], $baseMimeTypes),
650
-            TargetKind::COMPLEX_OBJECT()->getValue()              => array_merge([MimeTypes::MIME_APPLICATION_XML, MimeTypes::MIME_TEXTXML,], $baseMimeTypes),
651
-            TargetKind::BAG()->getValue()              => array_merge([MimeTypes::MIME_APPLICATION_XML, MimeTypes::MIME_TEXTXML,], $baseMimeTypes),
652
-            TargetKind::LINK()->getValue()              => array_merge([MimeTypes::MIME_APPLICATION_XML, MimeTypes::MIME_TEXTXML,], $baseMimeTypes),
649
+            TargetKind::PRIMITIVE()->getValue()              => array_merge([MimeTypes::MIME_APPLICATION_XML, MimeTypes::MIME_TEXTXML, ], $baseMimeTypes),
650
+            TargetKind::COMPLEX_OBJECT()->getValue()              => array_merge([MimeTypes::MIME_APPLICATION_XML, MimeTypes::MIME_TEXTXML, ], $baseMimeTypes),
651
+            TargetKind::BAG()->getValue()              => array_merge([MimeTypes::MIME_APPLICATION_XML, MimeTypes::MIME_TEXTXML, ], $baseMimeTypes),
652
+            TargetKind::LINK()->getValue()              => array_merge([MimeTypes::MIME_APPLICATION_XML, MimeTypes::MIME_TEXTXML, ], $baseMimeTypes),
653 653
             TargetKind::SINGLETON()->getValue()          => array_merge([MimeTypes::MIME_APPLICATION_ATOM], $baseMimeTypes),
654 654
             TargetKind::RESOURCE()->getValue()          => array_merge([MimeTypes::MIME_APPLICATION_ATOM], $baseMimeTypes),
655 655
         ];
656 656
 
657
-        if($targetKind && array_key_exists($targetKind->getValue(),$availableMimeTypesByTarget)){
657
+        if ($targetKind && array_key_exists($targetKind->getValue(), $availableMimeTypesByTarget)) {
658 658
             return HttpProcessUtility::selectMimeType($requestAcceptText, $availableMimeTypesByTarget[$targetKind->getValue()]);
659 659
 
660 660
         }
Please login to merge, or discard this patch.
Braces   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
                         $requestProperty->getName(),
561 561
                         $targetResourceType
562 562
                     );
563
-                } elseif ($requestTargetKind->isPRIMITIVE()){
563
+                } elseif ($requestTargetKind->isPRIMITIVE()) {
564 564
                     $odataModelInstance = $objectModelSerializer->writeTopLevelPrimitive(
565 565
                         $result,
566 566
                         $requestProperty
@@ -580,8 +580,7 @@  discard block
 block discarded – undo
580 580
         //Note: Response content type can be null for named stream
581 581
         if ($hasResponseBody && null !== $responseContentType &&
582 582
             TargetKind::MEDIA_RESOURCE() != $request->getTargetKind() &&
583
-            MimeTypes::MIME_APPLICATION_OCTETSTREAM != $responseContentType)
584
-        {
583
+            MimeTypes::MIME_APPLICATION_OCTETSTREAM != $responseContentType) {
585 584
             //append charset for everything except:
586 585
             //stream resources as they have their own content type
587 586
             //binary properties (they content type will be App Octet for those...is this a good way?
@@ -654,7 +653,7 @@  discard block
 block discarded – undo
654 653
             TargetKind::RESOURCE()->getValue()          => array_merge([MimeTypes::MIME_APPLICATION_ATOM], $baseMimeTypes),
655 654
         ];
656 655
 
657
-        if($targetKind && array_key_exists($targetKind->getValue(),$availableMimeTypesByTarget)){
656
+        if($targetKind && array_key_exists($targetKind->getValue(),$availableMimeTypesByTarget)) {
658 657
             return HttpProcessUtility::selectMimeType($requestAcceptText, $availableMimeTypesByTarget[$targetKind->getValue()]);
659 658
 
660 659
         }
Please login to merge, or discard this patch.