Completed
Pull Request — master (#127)
by Christopher
09:45
created
src/POData/Common/Messages/resourceType.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      */
62 62
     public static function resourceTypeMissingKeyPropertiesForEntity($entityName)
63 63
     {
64
-        return 'The entity type \''.$entityName.'\' does not have any key properties. Please make sure the key'
64
+        return 'The entity type \'' . $entityName . '\' does not have any key properties. Please make sure the key'
65 65
                 .' properties are defined for this entity type';
66 66
     }
67 67
 
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
      */
112 112
     public static function resourceTypePropertyWithSameNameAlreadyExists($propertyName, $resourceTypeName)
113 113
     {
114
-        return 'Property with same name \''.$propertyName.'\' already exists in type \''.$resourceTypeName
114
+        return 'Property with same name \'' . $propertyName . '\' already exists in type \'' . $resourceTypeName
115 115
                 .'\'. Please make sure that there is no property with the same name defined in one of the'
116 116
                 .' ancestor types';
117 117
     }
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
      */
158 158
     public static function resourceTypeNamedStreamWithSameNameAlreadyExists($namedStreamName, $resourceTypeName)
159 159
     {
160
-        return 'Named stream with the name \''.$namedStreamName.'\' already exists in type \''.$resourceTypeName
160
+        return 'Named stream with the name \'' . $namedStreamName . '\' already exists in type \'' . $resourceTypeName
161 161
                 .'\'. Please make sure that there is no named stream with the same name defined in one of the'
162 162
                 .' ancestor types';
163 163
     }
Please login to merge, or discard this patch.
src/POData/Common/Messages/metadataAssociationType.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
      */
15 15
     public static function metadataAssociationTypeSetBidirectionalAssociationMustReturnSameResourceAssociationSetFromBothEnd()
16 16
     {
17
-        return 'When the ResourceAssociationSet is bidirectional, IMetadataProvider::getResourceAssociationSet() must'.
17
+        return 'When the ResourceAssociationSet is bidirectional, IMetadataProvider::getResourceAssociationSet() must' .
18 18
                 ' return the same ResourceAssociationSet when call from both ends.';
19 19
     }
20 20
 
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
      */
32 32
     public static function metadataAssociationTypeSetMultipleAssociationSetsForTheSameAssociationTypeMustNotReferToSameEndSets($resourceSet1Name, $resourceSet2Name, $entitySetName)
33 33
     {
34
-        return 'ResourceAssociationSets \''.$resourceSet1Name.'\' and \''.$resourceSet2Name.'\' have a'
35
-                .' ResourceAssociationSetEnd referring to the same EntitySet \''.$entitySetName.'\' through the same'
34
+        return 'ResourceAssociationSets \'' . $resourceSet1Name . '\' and \'' . $resourceSet2Name . '\' have a'
35
+                .' ResourceAssociationSetEnd referring to the same EntitySet \'' . $entitySetName . '\' through the same'
36 36
                 .' AssociationType. Make sure that if two or more AssociationSets refer to the same AssociationType,'
37 37
                 .' the ends must not refer to the same EntitySet. (this could happen if multiple entity sets have'
38 38
                 .' entity types that have a common ancestor and the ancestor has a property of derived entity types)';
@@ -49,6 +49,6 @@  discard block
 block discarded – undo
49 49
     public static function metadataAssociationTypeSetInvalidGetDerivedTypesReturnType($resourceTypeName)
50 50
     {
51 51
         return 'Return type of IDSMP::getDerivedTypes should be either null or array of \'ResourceType\', check'
52
-                .' implementation of IDSMP::getDerivedTypes for the resource type \''.$resourceTypeName.'\'.';
52
+                .' implementation of IDSMP::getDerivedTypes for the resource type \'' . $resourceTypeName . '\'.';
53 53
     }
54 54
 }
Please login to merge, or discard this patch.
src/POData/Common/Messages/queryProvider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
      */
25 25
     public static function queryProviderResultCountMissing($methodName, QueryType $queryType)
26 26
     {
27
-        return 'The implementation of the method '.$methodName.' must return a QueryResult instance with a count for '
28
-                .'queries of type '.$queryType.'.';
27
+        return 'The implementation of the method ' . $methodName . ' must return a QueryResult instance with a count for '
28
+                .'queries of type ' . $queryType . '.';
29 29
     }
30 30
 
31 31
     /**
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
      */
37 37
     public static function queryProviderResultsMissing($methodName, QueryType $queryType)
38 38
     {
39
-        return 'The implementation of the method '.$methodName.' must return a QueryResult instance with an array'
40
-                .' of results for queries of type '.$queryType.'.';
39
+        return 'The implementation of the method ' . $methodName . ' must return a QueryResult instance with an array'
40
+                .' of results for queries of type ' . $queryType . '.';
41 41
     }
42 42
 }
Please login to merge, or discard this patch.
src/POData/Common/Messages/objectModelSerializer.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      */
31 31
     public static function badQueryNullKeysAreNotSupported($resourceTypeName, $keyName)
32 32
     {
33
-        return 'The serialized resource of type '.$resourceTypeName.' has a null value in key member \''.$keyName
33
+        return 'The serialized resource of type ' . $resourceTypeName . ' has a null value in key member \'' . $keyName
34 34
                 .'\'. Null values are not supported in key members.';
35 35
     }
36 36
 
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
      */
46 46
     public static function objectModelSerializerFailedToAccessProperty($propertyName, $parentObjectName)
47 47
     {
48
-        return 'objectModelSerializer failed to access or initialize the property '.$propertyName.' of '
49
-                .$parentObjectName.', Please contact provider.';
48
+        return 'objectModelSerializer failed to access or initialize the property ' . $propertyName . ' of '
49
+                .$parentObjectName . ', Please contact provider.';
50 50
     }
51 51
 
52 52
     /**
Please login to merge, or discard this patch.
src/POData/Common/Messages/expressionParser.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public static function expressionParserOperatorNotSupportNull($operator, $pos)
30 30
     {
31
-        return 'The operator \''.$operator.'\' at position '.$pos.' is not supported for the \'null\''
31
+        return 'The operator \'' . $operator . '\' at position ' . $pos . ' is not supported for the \'null\''
32 32
                 .' literal; only equality checks are supported';
33 33
     }
34 34
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
      */
43 43
     public static function expressionParserOperatorNotSupportGuid($operator, $pos)
44 44
     {
45
-        return 'The operator \''.$operator.'\' at position '.$pos.' is not supported for the Edm.Guid;'
45
+        return 'The operator \'' . $operator . '\' at position ' . $pos . ' is not supported for the Edm.Guid;'
46 46
                 .' only equality checks are supported';
47 47
     }
48 48
 
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      */
57 57
     public static function expressionParserOperatorNotSupportBinary($operator, $pos)
58 58
     {
59
-        return 'The operator \''.$operator.'\' at position '.$pos.' is not supported for the Edm.Binary;'
59
+        return 'The operator \'' . $operator . '\' at position ' . $pos . ' is not supported for the Edm.Binary;'
60 60
                 .' only equality checks are supported';
61 61
     }
62 62
 
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
      */
132 132
     public static function expressionParserEntityCollectionNotAllowedInFilter($property, $parentProperty, $pos)
133 133
     {
134
-        return 'The \''.$property.'\' is an entity collection property of \''.$parentProperty.'\' (position: '.$pos
134
+        return 'The \'' . $property . '\' is an entity collection property of \'' . $parentProperty . '\' (position: ' . $pos
135 135
                 .'), which cannot be used in $filter query option';
136 136
     }
137 137
 }
Please login to merge, or discard this patch.
src/POData/Common/Messages/eTag.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
      */
50 50
     public static function eTagCannotBeSpecified($uri)
51 51
     {
52
-        return 'If-Match or If-None-Match HTTP headers cannot be specified since the URI \''.$uri.'\' refers to a'
52
+        return 'If-Match or If-None-Match HTTP headers cannot be specified since the URI \'' . $uri . '\' refers to a'
53 53
                 .' collection of resources or has a $count or $link segment or has an $expand as one of the query'
54 54
                 .' parameters.';
55 55
     }
Please login to merge, or discard this patch.
src/POData/Common/Messages/metadataWriter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,8 +27,8 @@
 block discarded – undo
27 27
      */
28 28
     public static function metadataWriterNoResourceAssociationSetForNavigationProperty($navigationPropertyName, $resourceTypeName)
29 29
     {
30
-        return 'No visible ResourceAssociationSet found for navigation property \''.$navigationPropertyName.
31
-                '\' on type \''.$resourceTypeName.'\'. There must be at least one ResourceAssociationSet for'.
30
+        return 'No visible ResourceAssociationSet found for navigation property \'' . $navigationPropertyName .
31
+                '\' on type \'' . $resourceTypeName . '\'. There must be at least one ResourceAssociationSet for' .
32 32
                 ' each navigation property.';
33 33
     }
34 34
 }
Please login to merge, or discard this patch.
src/POData/ObjectModel/ObjectModelSerializer.php 1 patch
Spacing   +25 added lines, -25 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();
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
      * @return ODataPropertyContent
192 192
      */
193 193
     public function writeTopLevelComplexObject(
194
-        QueryResult &$complexValue,
194
+        QueryResult & $complexValue,
195 195
         $propertyName,
196 196
         ResourceType & $resourceType
197 197
     ) {
@@ -216,9 +216,9 @@  discard block
 block discarded – undo
216 216
      * @return ODataPropertyContent
217 217
      */
218 218
     public function writeTopLevelBagObject(
219
-        QueryResult &$bagValue,
219
+        QueryResult & $bagValue,
220 220
         $propertyName,
221
-        ResourceType &$resourceType
221
+        ResourceType & $resourceType
222 222
     ) {
223 223
         $propertyContent = new ODataPropertyContent();
224 224
         $this->writeBagValue(
@@ -241,8 +241,8 @@  discard block
 block discarded – undo
241 241
      * @return ODataPropertyContent
242 242
      */
243 243
     public function writeTopLevelPrimitive(
244
-        QueryResult &$primitiveValue,
245
-        ResourceProperty &$resourceProperty = null
244
+        QueryResult & $primitiveValue,
245
+        ResourceProperty & $resourceProperty = null
246 246
     ) {
247 247
         assert(null != $resourceProperty, 'Resource property must not be null');
248 248
         $propertyContent = new ODataPropertyContent();
@@ -330,11 +330,11 @@  discard block
 block discarded – undo
330 330
      */
331 331
     private function writeFeedElements(
332 332
         &$entryObjects,
333
-        ResourceType &$resourceType,
333
+        ResourceType & $resourceType,
334 334
         $title,
335 335
         $absoluteUri,
336 336
         $relativeUri,
337
-        ODataFeed &$feed,
337
+        ODataFeed & $feed,
338 338
         $needLink = false
339 339
     ) {
340 340
         assert(is_array($entryObjects), '!_writeFeedElements::is_array($entryObjects)');
@@ -391,11 +391,11 @@  discard block
 block discarded – undo
391 391
      */
392 392
     private function writeObjectProperties(
393 393
         $customObject,
394
-        ResourceType &$resourceType,
394
+        ResourceType & $resourceType,
395 395
         $absoluteUri,
396 396
         $relativeUri,
397 397
         &$odataEntry,
398
-        ODataPropertyContent &$odataPropertyContent
398
+        ODataPropertyContent & $odataPropertyContent
399 399
     ) {
400 400
         $resourceTypeKind = $resourceType->getResourceTypeKind();
401 401
         if ((null === $absoluteUri) == (ResourceTypeKind::ENTITY == $resourceTypeKind)
@@ -519,8 +519,8 @@  discard block
 block discarded – undo
519 519
      */
520 520
     private function writePrimitiveValue(
521 521
         &$primitiveValue,
522
-        ODataProperty &$odataProperty,
523
-        ResourceProperty &$resourceProperty
522
+        ODataProperty & $odataProperty,
523
+        ResourceProperty & $resourceProperty
524 524
     ) {
525 525
         if (is_object($primitiveValue)) {
526 526
             //TODO ERROR: The property 'PropertyName'
@@ -554,9 +554,9 @@  discard block
 block discarded – undo
554 554
     private function writeComplexValue(
555 555
         &$complexValue,
556 556
         $propertyName,
557
-        ResourceType &$resourceType,
557
+        ResourceType & $resourceType,
558 558
         $relativeUri,
559
-        ODataPropertyContent &$odataPropertyContent
559
+        ODataPropertyContent & $odataPropertyContent
560 560
     ) {
561 561
         $odataProperty = new ODataProperty();
562 562
         $odataProperty->name = $propertyName;
@@ -597,9 +597,9 @@  discard block
 block discarded – undo
597 597
     private function writeBagValue(
598 598
         &$bagValue,
599 599
         $propertyName,
600
-        ResourceType &$resourceType,
600
+        ResourceType & $resourceType,
601 601
         $relativeUri,
602
-        ODataPropertyContent &$odataPropertyContent
602
+        ODataPropertyContent & $odataPropertyContent
603 603
     ) {
604 604
         assert(null == $bagValue || is_array($bagValue), 'Bag parameter must be null or array');
605 605
         $bagItemResourceTypeKind = $resourceType->getResourceTypeKind();
@@ -657,10 +657,10 @@  discard block
 block discarded – undo
657 657
      */
658 658
     private function writeMediaResourceMetadata(
659 659
         $entryObject,
660
-        ResourceType &$resourceType,
660
+        ResourceType & $resourceType,
661 661
         $title,
662 662
         $relativeUri,
663
-        ODataEntry &$odataEntry
663
+        ODataEntry & $odataEntry
664 664
     ) {
665 665
         $streamProviderWrapper = $this->getService()->getStreamProviderWrapper();
666 666
         assert(null != $streamProviderWrapper, 'Retrieved stream provider must not be null');
@@ -733,7 +733,7 @@  discard block
 block discarded – undo
733 733
      * @return string
734 734
      */
735 735
     private function primitiveToString(
736
-        ResourceType &$primitiveResourceType,
736
+        ResourceType & $primitiveResourceType,
737 737
         $primitiveValue
738 738
     ) {
739 739
         $type = $primitiveResourceType->getInstanceType();
@@ -772,9 +772,9 @@  discard block
 block discarded – undo
772 772
     private function complexObjectToContent(
773 773
         &$complexValue,
774 774
         $propertyName,
775
-        ResourceType &$resourceType,
775
+        ResourceType & $resourceType,
776 776
         $relativeUri,
777
-        ODataPropertyContent &$odataPropertyContent
777
+        ODataPropertyContent & $odataPropertyContent
778 778
     ) {
779 779
         $count = count($this->complexTypeInstanceCollection);
780 780
         for ($i = 0; $i < $count; ++$i) {
@@ -817,9 +817,9 @@  discard block
 block discarded – undo
817 817
      */
818 818
     private function writeObjectPropertiesUnexpanded(
819 819
         $customObject,
820
-        ResourceType &$resourceType,
820
+        ResourceType & $resourceType,
821 821
         $relativeUri,
822
-        ODataPropertyContent &$odataPropertyContent,
822
+        ODataPropertyContent & $odataPropertyContent,
823 823
         $resourceTypeKind,
824 824
         $navigationProperties
825 825
     ) {
@@ -937,9 +937,9 @@  discard block
 block discarded – undo
937 937
      */
938 938
     private function writeObjectPropertiesExpanded(
939 939
         $customObject,
940
-        ResourceType &$resourceType,
940
+        ResourceType & $resourceType,
941 941
         $relativeUri,
942
-        ODataPropertyContent &$odataPropertyContent,
942
+        ODataPropertyContent & $odataPropertyContent,
943 943
         $projectionNodes,
944 944
         $navigationProperties
945 945
     ) {
Please login to merge, or discard this patch.
src/POData/Providers/Expression/PHPExpressionProvider.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -258,81 +258,81 @@
 block discarded – undo
258 258
     {
259 259
         switch ($functionDescription->name) {
260 260
             case ODataConstants::STRFUN_COMPARE:
261
-                return 'strcmp('.$params[0].', '.$params[1].')';
261
+                return 'strcmp(' . $params[0] . ', ' . $params[1] . ')';
262 262
 
263 263
             case ODataConstants::STRFUN_ENDSWITH:
264
-                return '(strcmp(substr('.$params[0].', strlen('.$params[0].') - strlen('.$params[1].')), '
265
-                        .$params[1].') === 0)';
264
+                return '(strcmp(substr(' . $params[0] . ', strlen(' . $params[0] . ') - strlen(' . $params[1] . ')), '
265
+                        .$params[1] . ') === 0)';
266 266
 
267 267
             case ODataConstants::STRFUN_INDEXOF:
268
-                return 'strpos('.$params[0].', '.$params[1].')';
268
+                return 'strpos(' . $params[0] . ', ' . $params[1] . ')';
269 269
 
270 270
             case ODataConstants::STRFUN_REPLACE:
271
-                return 'str_replace('.$params[1].', '.$params[2].', '.$params[0].')';
271
+                return 'str_replace(' . $params[1] . ', ' . $params[2] . ', ' . $params[0] . ')';
272 272
 
273 273
             case ODataConstants::STRFUN_STARTSWITH:
274
-                return '(strpos('.$params[0].', '.$params[1].') === 0)';
274
+                return '(strpos(' . $params[0] . ', ' . $params[1] . ') === 0)';
275 275
 
276 276
             case ODataConstants::STRFUN_TOLOWER:
277
-                return 'strtolower('.$params[0].')';
277
+                return 'strtolower(' . $params[0] . ')';
278 278
 
279 279
             case ODataConstants::STRFUN_TOUPPER:
280
-                return 'strtoupper('.$params[0].')';
280
+                return 'strtoupper(' . $params[0] . ')';
281 281
 
282 282
             case ODataConstants::STRFUN_TRIM:
283
-                return 'trim('.$params[0].')';
283
+                return 'trim(' . $params[0] . ')';
284 284
 
285 285
             case ODataConstants::STRFUN_SUBSTRING:
286 286
                 return count($params) == 3 ?
287
-                    'substr('.$params[0].', '.$params[1].', '.$params[2].')' : 'substr('.$params[0].', '.$params[1].')';
287
+                    'substr(' . $params[0] . ', ' . $params[1] . ', ' . $params[2] . ')' : 'substr(' . $params[0] . ', ' . $params[1] . ')';
288 288
 
289 289
             case ODataConstants::STRFUN_SUBSTRINGOF:
290
-                return '(strpos('.$params[1].', '.$params[0].') !== false)';
290
+                return '(strpos(' . $params[1] . ', ' . $params[0] . ') !== false)';
291 291
 
292 292
             case ODataConstants::STRFUN_CONCAT:
293 293
                 return $params[0] . ' . ' . $params[1];
294 294
 
295 295
             case ODataConstants::STRFUN_LENGTH:
296
-                return 'strlen('.$params[0].')';
296
+                return 'strlen(' . $params[0] . ')';
297 297
 
298 298
             case ODataConstants::GUIDFUN_EQUAL:
299
-                return self::TYPE_NAMESPACE . 'Guid::guidEqual('.$params[0].', '.$params[1].')';
299
+                return self::TYPE_NAMESPACE . 'Guid::guidEqual(' . $params[0] . ', ' . $params[1] . ')';
300 300
 
301 301
             case ODataConstants::DATETIME_COMPARE:
302
-                return self::TYPE_NAMESPACE . 'DateTime::dateTimeCmp('.$params[0].', '.$params[1].')';
302
+                return self::TYPE_NAMESPACE . 'DateTime::dateTimeCmp(' . $params[0] . ', ' . $params[1] . ')';
303 303
 
304 304
             case ODataConstants::DATETIME_YEAR:
305
-                return self::TYPE_NAMESPACE . 'DateTime::year('.$params[0].')';
305
+                return self::TYPE_NAMESPACE . 'DateTime::year(' . $params[0] . ')';
306 306
 
307 307
             case ODataConstants::DATETIME_MONTH:
308
-                return self::TYPE_NAMESPACE . 'DateTime::month('.$params[0].')';
308
+                return self::TYPE_NAMESPACE . 'DateTime::month(' . $params[0] . ')';
309 309
 
310 310
             case ODataConstants::DATETIME_DAY:
311
-                return self::TYPE_NAMESPACE . 'DateTime::day('.$params[0].')';
311
+                return self::TYPE_NAMESPACE . 'DateTime::day(' . $params[0] . ')';
312 312
 
313 313
             case ODataConstants::DATETIME_HOUR:
314
-                return self::TYPE_NAMESPACE . 'DateTime::hour('.$params[0].')';
314
+                return self::TYPE_NAMESPACE . 'DateTime::hour(' . $params[0] . ')';
315 315
 
316 316
             case ODataConstants::DATETIME_MINUTE:
317
-                return self::TYPE_NAMESPACE . 'DateTime::minute('.$params[0].')';
317
+                return self::TYPE_NAMESPACE . 'DateTime::minute(' . $params[0] . ')';
318 318
 
319 319
             case ODataConstants::DATETIME_SECOND:
320
-                return self::TYPE_NAMESPACE . 'DateTime::second('.$params[0].')';
320
+                return self::TYPE_NAMESPACE . 'DateTime::second(' . $params[0] . ')';
321 321
 
322 322
             case ODataConstants::MATHFUN_ROUND:
323
-                return 'round('.$params[0].')';
323
+                return 'round(' . $params[0] . ')';
324 324
 
325 325
             case ODataConstants::MATHFUN_CEILING:
326
-                return 'ceil('.$params[0].')';
326
+                return 'ceil(' . $params[0] . ')';
327 327
 
328 328
             case ODataConstants::MATHFUN_FLOOR:
329
-                return 'floor('.$params[0].')';
329
+                return 'floor(' . $params[0] . ')';
330 330
 
331 331
             case ODataConstants::BINFUL_EQUAL:
332
-                return self::TYPE_NAMESPACE . 'Binary::binaryEqual('.$params[0].', '.$params[1].')';
332
+                return self::TYPE_NAMESPACE . 'Binary::binaryEqual(' . $params[0] . ', ' . $params[1] . ')';
333 333
 
334 334
             case 'is_null':
335
-                return 'is_null('.$params[0].')';
335
+                return 'is_null(' . $params[0] . ')';
336 336
 
337 337
             default:
338 338
                 throw new \InvalidArgumentException('onFunctionCallExpression');
Please login to merge, or discard this patch.