@@ -103,6 +103,6 @@ |
||
| 103 | 103 | public function identifierIs($id) |
| 104 | 104 | { |
| 105 | 105 | return $this->Id == ExpressionTokenId::IDENTIFIER |
| 106 | - && strcmp($this->Text, (string)$id) == 0; |
|
| 106 | + && strcmp($this->Text, (string) $id) == 0; |
|
| 107 | 107 | } |
| 108 | 108 | } |
@@ -390,7 +390,7 @@ |
||
| 390 | 390 | $requestUrl = new Url(trim($m[2]), false); |
| 391 | 391 | $reader_state = RequestDescription::STATE_HEADERS; |
| 392 | 392 | } else if ($reader_state = RequestDescription::STATE_BODY) { |
| 393 | - $body .= $line."\n"; |
|
| 393 | + $body .= $line . "\n"; |
|
| 394 | 394 | } |
| 395 | 395 | } |
| 396 | 396 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | |
| 73 | - $lambda = function (RequestDescription &$request) use (&$service, $segments) { |
|
| 73 | + $lambda = function(RequestDescription &$request) use (&$service, $segments) { |
|
| 74 | 74 | $kind = $request->getTargetKind(); |
| 75 | 75 | |
| 76 | 76 | if ($kind == TargetKind::PRIMITIVE_VALUE || $kind == TargetKind::MEDIA_RESOURCE) { |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | }; |
| 117 | 117 | |
| 118 | 118 | // $uriProcessor = UriProcessor::process($this); |
| 119 | - foreach($request->getParts() as &$part) { |
|
| 119 | + foreach ($request->getParts() as &$part) { |
|
| 120 | 120 | |
| 121 | 121 | $uriProcessor = UriProcessor::processPart($service, $part); |
| 122 | 122 | |
@@ -360,7 +360,7 @@ discard block |
||
| 360 | 360 | $odataModelInstance = null; |
| 361 | 361 | $hasResponseBody = true; |
| 362 | 362 | |
| 363 | - $write = function ($service, $request, $odataModelInstance) use ($hasResponseBody, $responseContentType) { |
|
| 363 | + $write = function($service, $request, $odataModelInstance) use ($hasResponseBody, $responseContentType) { |
|
| 364 | 364 | //Note: Response content type can be null for named stream |
| 365 | 365 | if ($hasResponseBody && !is_null($responseContentType)) { |
| 366 | 366 | if ($request->getTargetKind() != TargetKind::MEDIA_RESOURCE && $responseContentType != MimeTypes::MIME_APPLICATION_OCTETSTREAM) { |
@@ -437,20 +437,20 @@ discard block |
||
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | $output_stream = ''; |
| 440 | - foreach($streams as $stream) { |
|
| 441 | - $output_stream.="--{$boundary}\r\n"; |
|
| 442 | - if (!is_null($stream['content_id'])) $output_stream.="Content-ID: {$stream['content_id']}\r\n"; |
|
| 443 | - $output_stream.="Content-Type: application/http\r\n"; |
|
| 444 | - $output_stream.="Content-Transfer-Encoding: binary\r\n"; |
|
| 445 | - $output_stream.="\r\n"; |
|
| 446 | - $output_stream.="{$_SERVER['SERVER_PROTOCOL']} 200 Ok\r\n"; |
|
| 447 | - $output_stream.="Content-Type: {$responseContentType}\r\n"; |
|
| 448 | - $output_stream.="Content-Length: {$stream['length']}\r\n"; |
|
| 449 | - $output_stream.="\r\n"; |
|
| 450 | - $output_stream.=$stream['body']."\r\n"; |
|
| 451 | - $output_stream.="\r\n"; |
|
| 440 | + foreach ($streams as $stream) { |
|
| 441 | + $output_stream .= "--{$boundary}\r\n"; |
|
| 442 | + if (!is_null($stream['content_id'])) $output_stream .= "Content-ID: {$stream['content_id']}\r\n"; |
|
| 443 | + $output_stream .= "Content-Type: application/http\r\n"; |
|
| 444 | + $output_stream .= "Content-Transfer-Encoding: binary\r\n"; |
|
| 445 | + $output_stream .= "\r\n"; |
|
| 446 | + $output_stream .= "{$_SERVER['SERVER_PROTOCOL']} 200 Ok\r\n"; |
|
| 447 | + $output_stream .= "Content-Type: {$responseContentType}\r\n"; |
|
| 448 | + $output_stream .= "Content-Length: {$stream['length']}\r\n"; |
|
| 449 | + $output_stream .= "\r\n"; |
|
| 450 | + $output_stream .= $stream['body'] . "\r\n"; |
|
| 451 | + $output_stream .= "\r\n"; |
|
| 452 | 452 | } |
| 453 | - $output_stream.="--{$boundary}--\r\n"; |
|
| 453 | + $output_stream .= "--{$boundary}--\r\n"; |
|
| 454 | 454 | $response->setStream($output_stream); |
| 455 | 455 | $this->_serviceHost->setResponseStatusCode(HttpStatus::CODE_ACCEPTED); |
| 456 | 456 | $this->_serviceHost->setResponseContentType("multipart/mixed; boundary={$boundary}"); |
@@ -439,7 +439,9 @@ |
||
| 439 | 439 | $output_stream = ''; |
| 440 | 440 | foreach($streams as $stream) { |
| 441 | 441 | $output_stream.="--{$boundary}\r\n"; |
| 442 | - if (!is_null($stream['content_id'])) $output_stream.="Content-ID: {$stream['content_id']}\r\n"; |
|
| 442 | + if (!is_null($stream['content_id'])) { |
|
| 443 | + $output_stream.="Content-ID: {$stream['content_id']}\r\n"; |
|
| 444 | + } |
|
| 443 | 445 | $output_stream.="Content-Type: application/http\r\n"; |
| 444 | 446 | $output_stream.="Content-Transfer-Encoding: binary\r\n"; |
| 445 | 447 | $output_stream.="\r\n"; |