Completed
Push — master ( 6f5720...a297dc )
by Nikolay
07:30
created
src/POData/Common/Messages.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
      */
172 172
     public static function expressionParser2NonPrimitivePropertyNotAllowed()
173 173
     {
174
-    	return 'This data service does not support non-primitive types in the expression';
174
+        return 'This data service does not support non-primitive types in the expression';
175 175
     }
176 176
 
177 177
     /** 
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
      */
605 605
     public static function providersWrapperInvalidExpressionProviderInstance()
606 606
     {
607
-    	return 'The value returned by IQueryProvider::getExpressionProvider method must be an implementation of IExpressionProvider';
607
+        return 'The value returned by IQueryProvider::getExpressionProvider method must be an implementation of IExpressionProvider';
608 608
     }
609 609
 
610 610
     /**
Please login to merge, or discard this patch.
src/POData/Common/MimeTypes.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,9 +15,9 @@
 block discarded – undo
15 15
 
16 16
     const MIME_APPLICATION_JSON_MINIMAL_META = 'application/json;odata=minimalmetadata';
17 17
 
18
-	const MIME_APPLICATION_JSON_NO_META = 'application/json;odata=nometadata';
18
+    const MIME_APPLICATION_JSON_NO_META = 'application/json;odata=nometadata';
19 19
 
20
-	const MIME_APPLICATION_JSON_FULL_META = 'application/json;odata=fullmetadata';
20
+    const MIME_APPLICATION_JSON_FULL_META = 'application/json;odata=fullmetadata';
21 21
 
22 22
     const MIME_APPLICATION_JSON_VERBOSE = 'application/json;odata=verbose';
23 23
 
Please login to merge, or discard this patch.
src/POData/Common/ODataConstants.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
     // Value for $format option for response atom format
31 31
     const FORMAT_ATOM = 'atom';
32 32
 
33
-	// Value for $format option for response atom format
34
-	const FORMAT_XML = 'xml';
33
+    // Value for $format option for response atom format
34
+    const FORMAT_XML = 'xml';
35 35
 
36 36
     //HTTP name for Accept header
37 37
     const HTTP_REQUEST_ACCEPT = 'Accept';
@@ -198,26 +198,26 @@  discard block
 block discarded – undo
198 198
     //metadata element name in json payload.
199 199
     const JSON_METADATA_STRING = '__metadata';
200 200
 
201
-	//metadata element name in json payload.
202
-	const JSON_LIGHT_METADATA_STRING = 'odata.metadata';
201
+    //metadata element name in json payload.
202
+    const JSON_LIGHT_METADATA_STRING = 'odata.metadata';
203 203
 
204 204
     //uri element name in json payload.
205 205
     const JSON_URI_STRING = 'uri';
206 206
 
207
-	//uri element name in json payload.
208
-	const JSON_URL_STRING = 'url';
207
+    //uri element name in json payload.
208
+    const JSON_URL_STRING = 'url';
209 209
 
210 210
     //type element name in json payload.
211 211
     const JSON_TYPE_STRING = 'type';
212 212
 
213
-	const JSON_LIGHT_METADATA_TYPE_STRING = 'odata.type';
214
-	const JSON_LIGHT_METADATA_ID_STRING = 'odata.id';
215
-	const JSON_LIGHT_METADATA_ETAG_STRING = 'odata.etag';
216
-	const JSON_LIGHT_METADATA_EDIT_LINK_STRING = 'odata.editLink';
217
-	const JSON_LIGHT_METADATA_PROPERTY_TYPE_SUFFIX_STRING = '@odata.type';
218
-	const JSON_LIGHT_METADATA_LINK_NAVIGATION_SUFFIX_STRING = '@odata.navigationLinkUrl';
213
+    const JSON_LIGHT_METADATA_TYPE_STRING = 'odata.type';
214
+    const JSON_LIGHT_METADATA_ID_STRING = 'odata.id';
215
+    const JSON_LIGHT_METADATA_ETAG_STRING = 'odata.etag';
216
+    const JSON_LIGHT_METADATA_EDIT_LINK_STRING = 'odata.editLink';
217
+    const JSON_LIGHT_METADATA_PROPERTY_TYPE_SUFFIX_STRING = '@odata.type';
218
+    const JSON_LIGHT_METADATA_LINK_NAVIGATION_SUFFIX_STRING = '@odata.navigationLinkUrl';
219 219
 
220
-	//edit_media element name in json payload.
220
+    //edit_media element name in json payload.
221 221
     const JSON_EDITMEDIA_STRING = 'edit_media';
222 222
 
223 223
     //media_src element name in json payload.
@@ -238,19 +238,19 @@  discard block
 block discarded – undo
238 238
     //row count element name in json payload
239 239
     const JSON_ROWCOUNT_STRING = '__count';
240 240
 
241
-	//row count element name in json payload
242
-	const JSON_LIGHT_ROWCOUNT_STRING = 'odata.count';
241
+    //row count element name in json payload
242
+    const JSON_LIGHT_ROWCOUNT_STRING = 'odata.count';
243 243
 
244 244
     //next page link element name in json payload
245 245
     const JSON_NEXT_STRING = '__next';
246 246
 
247
-	const JSON_LIGHT_NEXT_STRING = 'odata.next';
247
+    const JSON_LIGHT_NEXT_STRING = 'odata.next';
248 248
 
249 249
     //'results' header for Json data array
250 250
     const JSON_RESULT_NAME = 'results';
251 251
 
252
-	//'results' header for Json data array
253
-	const JSON_LIGHT_VALUE_NAME = 'value';
252
+    //'results' header for Json data array
253
+    const JSON_LIGHT_VALUE_NAME = 'value';
254 254
 
255 255
     const JSON_DATAWRAPPER_ELEMENT_NAME = 'd';
256 256
 
@@ -826,8 +826,8 @@  discard block
 block discarded – undo
826 826
     const HTTPREQUEST_HEADER_IF_NONE         = 'IF_NONE_MATCH';
827 827
     const HTTPREQUEST_HEADER_IF_UNMODIFIED   = 'IF_UNMODIFIED_SINCE';
828 828
 
829
-	const HTTPREQUEST_HEADER_DATA_SERVICE_VERSION       = 'DATASERVICEVERSION';
830
-	const HTTPREQUEST_HEADER_MAX_DATA_SERVICE_VERSION   = 'MAXDATASERVICEVERSION';
829
+    const HTTPREQUEST_HEADER_DATA_SERVICE_VERSION       = 'DATASERVICEVERSION';
830
+    const HTTPREQUEST_HEADER_MAX_DATA_SERVICE_VERSION   = 'MAXDATASERVICEVERSION';
831 831
 
832 832
     // Headers for HTTPResponse
833 833
     // We need to use these string with header() for setting-up these headers
Please login to merge, or discard this patch.
src/POData/Common/Version.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -70,13 +70,13 @@  discard block
 block discarded – undo
70 70
         if ($major > $this->major) {
71 71
             $this->major = $major;
72 72
             $this->minor = $minor;
73
-	        return true;
73
+            return true;
74 74
         } else if ($major == $this->major && $minor > $this->minor) {
75 75
             $this->minor = $minor;
76
-	        return true;
76
+            return true;
77 77
         }
78 78
 
79
-	    return false;
79
+        return false;
80 80
     }
81 81
 
82 82
     /**
@@ -117,37 +117,37 @@  discard block
 block discarded – undo
117 117
         return $this->major . '.' . $this->minor;
118 118
     }
119 119
 
120
-	//Is there a better way to do static const of complex type?
120
+    //Is there a better way to do static const of complex type?
121 121
 
122
-	/** @var Version[] */
123
-	private static $fixedVersion;
122
+    /** @var Version[] */
123
+    private static $fixedVersion;
124 124
 
125
-	private static function fillVersions(){
126
-		if(is_null(self::$fixedVersion)){
127
-			self::$fixedVersion = array(
128
-				1 => new Version(1,0),
129
-				2 => new Version(2,0),
130
-				3 => new Version(3,0),
131
-			);
132
-		}
133
-	}
125
+    private static function fillVersions(){
126
+        if(is_null(self::$fixedVersion)){
127
+            self::$fixedVersion = array(
128
+                1 => new Version(1,0),
129
+                2 => new Version(2,0),
130
+                3 => new Version(3,0),
131
+            );
132
+        }
133
+    }
134 134
 
135
-	public static function v1()
136
-	{
137
-		self::fillVersions();
138
-		return self::$fixedVersion[1];
139
-	}
135
+    public static function v1()
136
+    {
137
+        self::fillVersions();
138
+        return self::$fixedVersion[1];
139
+    }
140 140
 
141 141
 
142
-	public static function v2(){
143
-		self::fillVersions();
144
-		return self::$fixedVersion[2];
145
-	}
142
+    public static function v2(){
143
+        self::fillVersions();
144
+        return self::$fixedVersion[2];
145
+    }
146 146
 
147 147
 
148
-	public static function v3(){
149
-		self::fillVersions();
150
-		return self::$fixedVersion[3];
151
-	}
148
+    public static function v3(){
149
+        self::fillVersions();
150
+        return self::$fixedVersion[3];
151
+    }
152 152
 
153 153
 }
154 154
\ No newline at end of file
Please login to merge, or discard this patch.
src/POData/Configuration/ServiceConfiguration.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 
112 112
         $this->maxVersion = ProtocolVersion::V3(); //We default to the highest version
113 113
 
114
-	    $this->_validateETagHeader = true;
114
+        $this->_validateETagHeader = true;
115 115
     }
116 116
     
117 117
     /**
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
         }
195 195
 
196 196
         $this->_maxResultsPerCollection= $this->_checkIntegerNonNegativeParameter(
197
-			$maxResultPerCollection, 'setMaxResultsPerCollection'
197
+            $maxResultPerCollection, 'setMaxResultsPerCollection'
198 198
         );
199 199
     }
200 200
 
@@ -382,15 +382,15 @@  discard block
 block discarded – undo
382 382
     public function getMaxDataServiceVersion()
383 383
     {
384 384
         switch ($this->maxVersion) {
385
-	        case ProtocolVersion::V1():
386
-	            return new Version(1, 0);
385
+            case ProtocolVersion::V1():
386
+                return new Version(1, 0);
387 387
 
388
-	        case ProtocolVersion::V2():
389
-	            return new Version(2, 0);
388
+            case ProtocolVersion::V2():
389
+                return new Version(2, 0);
390 390
 
391
-	        case ProtocolVersion::V3():
392
-	        default:
393
-	            return new Version(3, 0);
391
+            case ProtocolVersion::V3():
392
+            default:
393
+                return new Version(3, 0);
394 394
         }
395 395
     }
396 396
 
@@ -406,31 +406,31 @@  discard block
 block discarded – undo
406 406
         $this->maxVersion = $version;
407 407
     }
408 408
 
409
-     /**
410
-      * Specify whether to validate the ETag or not
411
-      *
412
-      * @param boolean $validate True if ETag needs to validated, false otherwise.
413
-      *
414
-      * @return void
415
-      */
416
-     function setValidateETagHeader($validate)
417
-     {
418
-         $this->_validateETagHeader = $validate;
419
-     }
420
-
421
-     /**
422
-      * Gets whether to validate the ETag or not
423
-      *
424
-      * @return boolean True if ETag needs to validated, false
425
-      *                 if its not to be validated, Note that in case
426
-      *                 of false library will not write the ETag header
427
-      *                 in the response even though the requested resource
428
-      *                 support ETag
429
-      */
430
-     function getValidateETagHeader()
431
-     {
432
-         return $this->_validateETagHeader;
433
-     }
409
+        /**
410
+         * Specify whether to validate the ETag or not
411
+         *
412
+         * @param boolean $validate True if ETag needs to validated, false otherwise.
413
+         *
414
+         * @return void
415
+         */
416
+        function setValidateETagHeader($validate)
417
+        {
418
+            $this->_validateETagHeader = $validate;
419
+        }
420
+
421
+        /**
422
+         * Gets whether to validate the ETag or not
423
+         *
424
+         * @return boolean True if ETag needs to validated, false
425
+         *                 if its not to be validated, Note that in case
426
+         *                 of false library will not write the ETag header
427
+         *                 in the response even though the requested resource
428
+         *                 support ETag
429
+         */
430
+        function getValidateETagHeader()
431
+        {
432
+            return $this->_validateETagHeader;
433
+        }
434 434
 
435 435
 
436 436
 
Please login to merge, or discard this patch.
src/POData/HttpProcessUtility.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
                 //the rest look like QSPs..kinda so we can do this
104 104
                 parse_str(implode("&", $candidateParts), $candidateParts);
105 105
                 if(array_key_exists('odata', $candidateParts)){
106
-                   $candidateODataValue = $candidateParts['odata'];
106
+                    $candidateODataValue = $candidateParts['odata'];
107 107
                 }
108 108
             }
109 109
 
@@ -697,7 +697,7 @@  discard block
 block discarded – undo
697 697
     }
698 698
 
699 699
 
700
-	public static function headerToServerKey($headerName){
701
-		return 'HTTP_' . strtoupper(str_replace('-', '_', $headerName));
702
-	}
700
+    public static function headerToServerKey($headerName){
701
+        return 'HTTP_' . strtoupper(str_replace('-', '_', $headerName));
702
+    }
703 703
 }
704 704
\ No newline at end of file
Please login to merge, or discard this patch.
src/POData/IService.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -71,9 +71,9 @@
 block discarded – undo
71 71
     public function getOperationContext();
72 72
 
73 73
 
74
-	/**
75
-	 * Returns the ODataWriterRegistry to use when writing the response to a service document or resource request
76
-	 * @return ODataWriterRegistry
77
-	 */
78
-	public function getODataWriterRegistry();
74
+    /**
75
+     * Returns the ODataWriterRegistry to use when writing the response to a service document or resource request
76
+     * @return ODataWriterRegistry
77
+     */
78
+    public function getODataWriterRegistry();
79 79
 }
80 80
\ No newline at end of file
Please login to merge, or discard this patch.
src/POData/ObjectModel/ODataEntry.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -78,11 +78,11 @@
 block discarded – undo
78 78
      */
79 79
     public $isMediaLinkEntry;
80 80
 
81
-	/**
82
-	 * The name of the resource set this entry belongs to, use in metadata output
83
-	 * @var string
84
-	 */
85
-	public $resourceSetName;
81
+    /**
82
+     * The name of the resource set this entry belongs to, use in metadata output
83
+     * @var string
84
+     */
85
+    public $resourceSetName;
86 86
     
87 87
 
88 88
 }
89 89
\ No newline at end of file
Please login to merge, or discard this patch.
src/POData/ObjectModel/ObjectModelSerializer.php 1 patch
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
         $needPop = $this->pushSegmentForRoot();
67 67
         $entry = $this->_writeEntryElement(
68 68
             $entryObject,
69
-	        $resourceType,
69
+            $resourceType,
70 70
             $this->request->getRequestUrl()->getUrlAsString(),
71 71
             $this->request->getContainerName()
72 72
         );
@@ -189,18 +189,18 @@  discard block
 block discarded – undo
189 189
      * @return ODataPropertyContent
190 190
      */
191 191
     public function writeTopLevelComplexObject(
192
-	    &$complexValue,
192
+        &$complexValue,
193 193
         $propertyName,
194 194
         ResourceType &$resourceType
195 195
     ) {
196
-	    $propertyContent = new ODataPropertyContent();
196
+        $propertyContent = new ODataPropertyContent();
197 197
         $this->_writeComplexValue(
198 198
             $complexValue,
199 199
             $propertyName, $resourceType, null,
200
-	        $propertyContent
200
+            $propertyContent
201 201
         );
202 202
 
203
-	    return $propertyContent;
203
+        return $propertyContent;
204 204
     }
205 205
 
206 206
     /**
@@ -216,19 +216,19 @@  discard block
 block discarded – undo
216 216
      * @return ODataPropertyContent
217 217
      */
218 218
     public function writeTopLevelBagObject(
219
-	    &$BagValue,
219
+        &$BagValue,
220 220
         $propertyName,
221 221
         ResourceType &$resourceType
222 222
     ) {
223 223
 
224
-	    $propertyContent = new ODataPropertyContent();
224
+        $propertyContent = new ODataPropertyContent();
225 225
         $this->_writeBagValue(
226 226
             $BagValue,
227 227
             $propertyName, $resourceType, null,
228
-	        $propertyContent
228
+            $propertyContent
229 229
         );
230 230
 
231
-	    return $propertyContent;
231
+        return $propertyContent;
232 232
     }
233 233
 
234 234
     /**
@@ -244,18 +244,18 @@  discard block
 block discarded – undo
244 244
      * @return ODataPropertyContent
245 245
      */
246 246
     public function writeTopLevelPrimitive(
247
-	    &$primitiveValue,
247
+        &$primitiveValue,
248 248
         ResourceProperty &$resourceProperty
249 249
     ) {
250
-	    $propertyContent = new ODataPropertyContent();
251
-	    $propertyContent->properties[] = new ODataProperty();
250
+        $propertyContent = new ODataPropertyContent();
251
+        $propertyContent->properties[] = new ODataProperty();
252 252
         $this->_writePrimitiveValue(
253 253
             $primitiveValue, 
254 254
             $resourceProperty,
255
-	        $propertyContent->properties[0]
255
+            $propertyContent->properties[0]
256 256
         );
257 257
 
258
-	    return $propertyContent;
258
+        return $propertyContent;
259 259
     }
260 260
 
261 261
     /**
@@ -274,8 +274,8 @@  discard block
 block discarded – undo
274 274
         $absoluteUri,
275 275
         $relativeUri
276 276
     ) {
277
-	    $entry = new ODataEntry();
278
-	    $entry->resourceSetName = $this->getCurrentResourceSetWrapper()->getName();
277
+        $entry = new ODataEntry();
278
+        $entry->resourceSetName = $this->getCurrentResourceSetWrapper()->getName();
279 279
 
280 280
         if (is_null($entryObject)) {
281 281
             //According to atom standard an empty entry must have an Author
@@ -296,27 +296,27 @@  discard block
 block discarded – undo
296 296
                 $actualResourceType,
297 297
                 $title,
298 298
                 $relativeUri,
299
-	            $entry
299
+                $entry
300 300
             );
301 301
 
302
-	        $entry->id = $absoluteUri;
303
-	        $entry->eTag = $this->getETagForEntry($entryObject, $resourceType);
304
-	        $entry->title = $title;
305
-	        $entry->editLink = $relativeUri;
306
-	        $entry->type = $actualResourceType->getFullName();
302
+            $entry->id = $absoluteUri;
303
+            $entry->eTag = $this->getETagForEntry($entryObject, $resourceType);
304
+            $entry->title = $title;
305
+            $entry->editLink = $relativeUri;
306
+            $entry->type = $actualResourceType->getFullName();
307 307
             $odataPropertyContent = new ODataPropertyContent();
308 308
             $this->_writeObjectProperties(
309 309
                 $entryObject, 
310 310
                 $actualResourceType,
311 311
                 $absoluteUri,
312 312
                 $relativeUri,
313
-	            $entry,
313
+                $entry,
314 314
                 $odataPropertyContent
315 315
             );
316
-	        $entry->propertyContent = $odataPropertyContent;
316
+            $entry->propertyContent = $odataPropertyContent;
317 317
         }
318 318
 
319
-	    return $entry;
319
+        return $entry;
320 320
     }
321 321
 
322 322
     /**
@@ -388,7 +388,7 @@  discard block
 block discarded – undo
388 388
      * @return void
389 389
      */
390 390
     private function _writeObjectProperties(
391
-	    $customObject,
391
+        $customObject,
392 392
         ResourceType &$resourceType, 
393 393
         $absoluteUri, 
394 394
         $relativeUri, 
@@ -486,12 +486,12 @@  discard block
 block discarded – undo
486 486
                     ) {
487 487
                         continue;  
488 488
                     } else {
489
-                         $this->assert(
490
-                             ($resourcePropertyKind == ResourcePropertyKind::RESOURCE_REFERENCE)
489
+                            $this->assert(
490
+                                ($resourcePropertyKind == ResourcePropertyKind::RESOURCE_REFERENCE)
491 491
                              || ($resourcePropertyKind == ResourcePropertyKind::RESOURCESET_REFERENCE), 
492
-                             '($resourcePropertyKind == ResourcePropertyKind::RESOURCE_REFERENCE)
492
+                                '($resourcePropertyKind == ResourcePropertyKind::RESOURCE_REFERENCE)
493 493
                              || ($resourcePropertyKind == ResourcePropertyKind::RESOURCESET_REFERENCE)'
494
-                         );
494
+                            );
495 495
 
496 496
                         $navigationProperties[$i] = new NavigationPropertyInfo($resourceProperty, $this->shouldExpandSegment($resourceProperty->getName()));
497 497
                         if ($navigationProperties[$i]->expanded) {
@@ -611,10 +611,10 @@  discard block
 block discarded – undo
611 611
                             $currentResourceType1 = $currentResourceSetWrapper->getResourceType();
612 612
 
613 613
                             $link->expandedResult = $this->_writeEntryElement(
614
-	                            $navigationPropertyInfo->value,
615
-	                            $currentResourceType1,
616
-	                            $propertyAbsoluteUri,
617
-	                            $propertyRelativeUri
614
+                                $navigationPropertyInfo->value,
615
+                                $currentResourceType1,
616
+                                $propertyAbsoluteUri,
617
+                                $propertyRelativeUri
618 618
                             );
619 619
                         }
620 620
                     } else {
Please login to merge, or discard this patch.