@@ -365,7 +365,6 @@ |
||
| 365 | 365 | /** |
| 366 | 366 | * Draw the page |
| 367 | 367 | * |
| 368 | - * @param boolean $header Draw the header |
|
| 369 | 368 | */ |
| 370 | 369 | public function printPage($response) |
| 371 | 370 | { |
@@ -727,7 +727,7 @@ |
||
| 727 | 727 | */ |
| 728 | 728 | private function addJSGlobals() |
| 729 | 729 | { |
| 730 | - $this->body = $this->body.'<script> |
|
| 730 | + $this->body = $this->body.'<script> |
|
| 731 | 731 | var profilesUrl = \''.$this->profilesUrl.'\' |
| 732 | 732 | var loginUrl = \''.$this->loginUrl.'\' |
| 733 | 733 | var logoutUrl = \''.$this->logoutUrl.'\' |
@@ -125,12 +125,12 @@ |
||
| 125 | 125 | protected function printHead($response) |
| 126 | 126 | { |
| 127 | 127 | $head = '<HEAD><TITLE>'.$this->title.'</TITLE>'; |
| 128 | - $head.='<meta name="viewport" content="width=device-width, initial-scale=1.0">'; |
|
| 128 | + $head .= '<meta name="viewport" content="width=device-width, initial-scale=1.0">'; |
|
| 129 | 129 | foreach($this->headTags as $tag) |
| 130 | 130 | { |
| 131 | - $head.=$tag."\n"; |
|
| 131 | + $head .= $tag."\n"; |
|
| 132 | 132 | } |
| 133 | - $head.='</HEAD>'; |
|
| 133 | + $head .= '</HEAD>'; |
|
| 134 | 134 | return $response->write($head); |
| 135 | 135 | } |
| 136 | 136 | |
@@ -24,6 +24,9 @@ discard block |
||
| 24 | 24 | } |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | + /** |
|
| 28 | + * @param string $param |
|
| 29 | + */ |
|
| 27 | 30 | private function getParamFromArrayIfSet($array, $param, $default = null) |
| 28 | 31 | { |
| 29 | 32 | if(isset($array[$param])) |
@@ -52,6 +55,9 @@ discard block |
||
| 52 | 55 | return $response; |
| 53 | 56 | } |
| 54 | 57 | |
| 58 | + /** |
|
| 59 | + * @param string $serializer |
|
| 60 | + */ |
|
| 55 | 61 | protected function reserializeBody($response, $serializer) |
| 56 | 62 | { |
| 57 | 63 | $body = $response->getBody(); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | $dataTable = $this->getDataTable(); |
| 76 | 76 | $odata = $request->getAttribute('odata', new \ODataParams(array())); |
| 77 | 77 | $areas = $dataTable->read($odata->filter, $odata->select, $odata->top, |
| 78 | - $odata->skip, $odata->orderby); |
|
| 78 | + $odata->skip, $odata->orderby); |
|
| 79 | 79 | return $response->withJson($areas); |
| 80 | 80 | } |
| 81 | 81 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | $odata = $request->getAttribute('odata', new \ODataParams(array())); |
| 102 | 102 | $filter = $this->getFilterForPrimaryKey($args['name']); |
| 103 | 103 | $areas = $dataTable->read($filter, $odata->select, $odata->top, |
| 104 | - $odata->skip, $odata->orderby); |
|
| 104 | + $odata->skip, $odata->orderby); |
|
| 105 | 105 | if(empty($areas)) |
| 106 | 106 | { |
| 107 | 107 | return $response->withStatus(404); |
@@ -13,5 +13,5 @@ |
||
| 13 | 13 | ->withStatus(500) |
| 14 | 14 | ->withHeader('Content-Type', 'text/html') |
| 15 | 15 | ->write(print_r($exception, true)); |
| 16 | - } |
|
| 16 | + } |
|
| 17 | 17 | } |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | { |
| 13 | 13 | parent::__construct(); |
| 14 | 14 | $c = $this->getContainer(); |
| 15 | - $c['errorHandler'] = function($c) { return new WebErrorHandler();}; |
|
| 15 | + $c['errorHandler'] = function($c) { return new WebErrorHandler(); }; |
|
| 16 | 16 | $this->add(new AuthMiddleware()); |
| 17 | 17 | $this->add(new ODataMiddleware()); |
| 18 | 18 | } |
@@ -24,6 +24,6 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | public function registerAPI($uri, $api) |
| 26 | 26 | { |
| 27 | - $this->group($uri, function() use($api) {$api->setup($this);})->add(new \Http\Rest\SerializationMiddleware()); |
|
| 27 | + $this->group($uri, function() use($api) {$api->setup($this); })->add(new \Http\Rest\SerializationMiddleware()); |
|
| 28 | 28 | } |
| 29 | 29 | } |
@@ -12,7 +12,9 @@ discard block |
||
| 12 | 12 | { |
| 13 | 13 | parent::__construct(); |
| 14 | 14 | $c = $this->getContainer(); |
| 15 | - $c['errorHandler'] = function($c) { return new WebErrorHandler();}; |
|
| 15 | + $c['errorHandler'] = function($c) |
|
| 16 | + { |
|
| 17 | +return new WebErrorHandler();}; |
|
| 16 | 18 | $this->add(new AuthMiddleware()); |
| 17 | 19 | $this->add(new ODataMiddleware()); |
| 18 | 20 | } |
@@ -24,6 +26,8 @@ discard block |
||
| 24 | 26 | |
| 25 | 27 | public function registerAPI($uri, $api) |
| 26 | 28 | { |
| 27 | - $this->group($uri, function() use($api) {$api->setup($this);})->add(new \Http\Rest\SerializationMiddleware()); |
|
| 29 | + $this->group($uri, function() use($api) |
|
| 30 | + { |
|
| 31 | +$api->setup($this);})->add(new \Http\Rest\SerializationMiddleware()); |
|
| 28 | 32 | } |
| 29 | 33 | } |