@@ -364,8 +364,7 @@ discard block |
||
| 364 | 364 | try |
| 365 | 365 | { |
| 366 | 366 | $resourceType->getInstanceType()->getProperty($name); |
| 367 | - } |
|
| 368 | - catch (\ReflectionException $ex) |
|
| 367 | + } catch (\ReflectionException $ex) |
|
| 369 | 368 | { |
| 370 | 369 | throw new InvalidOperationException('Can\'t add a property which does not exist on the instance type.'); |
| 371 | 370 | } |
@@ -397,8 +396,7 @@ discard block |
||
| 397 | 396 | try |
| 398 | 397 | { |
| 399 | 398 | $resourceType->getInstanceType()->getProperty($name); |
| 400 | - } |
|
| 401 | - catch (\ReflectionException $ex) |
|
| 399 | + } catch (\ReflectionException $ex) |
|
| 402 | 400 | { |
| 403 | 401 | throw new InvalidOperationException( |
| 404 | 402 | 'Can\'t add a property which does not exist on the instance type.' |
@@ -25,16 +25,26 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | public static function adjustCountForPaging($count, $top, $skip){ |
| 27 | 27 | |
| 28 | - if(!is_numeric($count)) throw new \InvalidArgumentException('$count'); |
|
| 28 | + if(!is_numeric($count)) { |
|
| 29 | + throw new \InvalidArgumentException('$count'); |
|
| 30 | + } |
|
| 29 | 31 | |
| 30 | 32 | //treat nulls like 0 |
| 31 | - if(is_null($skip)) $skip = 0; |
|
| 33 | + if(is_null($skip)) { |
|
| 34 | + $skip = 0; |
|
| 35 | + } |
|
| 32 | 36 | |
| 33 | 37 | |
| 34 | 38 | $count = $count - $skip; //eliminate the skipped records |
| 35 | - if($count < 0) return 0; //if there aren't enough to skip, the count is 0 |
|
| 36 | - |
|
| 37 | - if(is_null($top)) return $count; //if there's no top, then it's the count as is |
|
| 39 | + if($count < 0) { |
|
| 40 | + return 0; |
|
| 41 | + } |
|
| 42 | + //if there aren't enough to skip, the count is 0 |
|
| 43 | + |
|
| 44 | + if(is_null($top)) { |
|
| 45 | + return $count; |
|
| 46 | + } |
|
| 47 | + //if there's no top, then it's the count as is |
|
| 38 | 48 | |
| 39 | 49 | return min($count, $top); //count is top, unless there aren't enough records |
| 40 | 50 | |
@@ -297,7 +297,9 @@ |
||
| 297 | 297 | $inlineCount = $this->service->getHost()->getQueryStringItem( ODataConstants::HTTPQUERY_STRING_INLINECOUNT ); |
| 298 | 298 | |
| 299 | 299 | //If it's not specified, we're done |
| 300 | - if(is_null($inlineCount)) return; |
|
| 300 | + if(is_null($inlineCount)) { |
|
| 301 | + return; |
|
| 302 | + } |
|
| 301 | 303 | |
| 302 | 304 | //If the service doesn't allow count requests..then throw an exception |
| 303 | 305 | if (!$this->service->getConfiguration()->getAcceptCountRequests()) { |
@@ -367,7 +367,9 @@ |
||
| 367 | 367 | if (!empty($result)) { |
| 368 | 368 | $top = $this->request->getTopCount(); |
| 369 | 369 | $skip = $this->request->getSkipCount(); |
| 370 | - if(is_null($skip)) $skip = 0; |
|
| 370 | + if(is_null($skip)) { |
|
| 371 | + $skip = 0; |
|
| 372 | + } |
|
| 371 | 373 | |
| 372 | 374 | $result = array_slice($result, $skip, $top); |
| 373 | 375 | } |
@@ -98,7 +98,9 @@ |
||
| 98 | 98 | */ |
| 99 | 99 | public function decreaseIndent() |
| 100 | 100 | { |
| 101 | - if($this->indentLevel > 0) $this->indentLevel--; |
|
| 101 | + if($this->indentLevel > 0) { |
|
| 102 | + $this->indentLevel--; |
|
| 103 | + } |
|
| 102 | 104 | return $this; |
| 103 | 105 | } |
| 104 | 106 | |
@@ -107,7 +107,7 @@ |
||
| 107 | 107 | ->startArrayScope(); |
| 108 | 108 | $this->writeFeed($model); |
| 109 | 109 | $this->_writer->endScope(); |
| 110 | - }elseif ($model instanceof ODataEntry) { |
|
| 110 | + } elseif ($model instanceof ODataEntry) { |
|
| 111 | 111 | $this->writeTopLevelMeta($model->resourceSetName . "/@Element"); |
| 112 | 112 | $this->writeEntry($model); |
| 113 | 113 | } |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | } elseif ($model instanceof ODataFeed) { |
| 89 | 89 | $this->_writer->startArrayScope(); |
| 90 | 90 | $this->writeFeed($model); |
| 91 | - }elseif ($model instanceof ODataEntry) { |
|
| 91 | + } elseif ($model instanceof ODataEntry) { |
|
| 92 | 92 | $this->_writer->startObjectScope(); |
| 93 | 93 | $this->writeEntry($model); |
| 94 | 94 | } |
@@ -276,8 +276,7 @@ discard block |
||
| 276 | 276 | if ($link->isExpanded) { |
| 277 | 277 | if(is_null($link->expandedResult)){ |
| 278 | 278 | $this->_writer->writeValue("null"); |
| 279 | - } |
|
| 280 | - else{ |
|
| 279 | + } else{ |
|
| 281 | 280 | $this->writeExpandedLink($link); |
| 282 | 281 | } |
| 283 | 282 | } else { |
@@ -96,7 +96,7 @@ |
||
| 96 | 96 | $this->writeFeed($model); |
| 97 | 97 | $this->_writer->endScope(); |
| 98 | 98 | |
| 99 | - }elseif ($model instanceof ODataEntry) { |
|
| 99 | + } elseif ($model instanceof ODataEntry) { |
|
| 100 | 100 | $this->writeEntry($model); |
| 101 | 101 | } |
| 102 | 102 | |
@@ -36,7 +36,9 @@ |
||
| 36 | 36 | |
| 37 | 37 | foreach($this->writers as $writer) |
| 38 | 38 | { |
| 39 | - if($writer->canHandle($responseVersion, $contentType)) return $writer; |
|
| 39 | + if($writer->canHandle($responseVersion, $contentType)) { |
|
| 40 | + return $writer; |
|
| 41 | + } |
|
| 40 | 42 | } |
| 41 | 43 | |
| 42 | 44 | return null; |