@@ -33,7 +33,7 @@ |
||
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * @param string $file |
| 36 | - * @return bool|string |
|
| 36 | + * @return string|false |
|
| 37 | 37 | */ |
| 38 | 38 | public function locate($file) |
| 39 | 39 | { |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | */ |
| 38 | 38 | public function locate($file) |
| 39 | 39 | { |
| 40 | - $file = substr($file,0,1) ==='/' ? substr($file,1) : $file; |
|
| 40 | + $file = substr($file, 0, 1) === '/' ? substr($file, 1) : $file; |
|
| 41 | 41 | foreach ($this->dirs as $system) { |
| 42 | 42 | $location = $system . $file; |
| 43 | 43 | if (file_exists($location)) { |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | */ |
| 24 | 24 | public function start() |
| 25 | 25 | { |
| 26 | - $this->ob_level ++; |
|
| 26 | + $this->ob_level++; |
|
| 27 | 27 | ob_start(); |
| 28 | 28 | } |
| 29 | 29 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * @param LocatorInterface $locator |
| 58 | 58 | * @param null|Section $section |
| 59 | 59 | */ |
| 60 | - public function __construct($locator, $section=null) |
|
| 60 | + public function __construct($locator, $section = null) |
|
| 61 | 61 | { |
| 62 | 62 | $this->locator = $locator; |
| 63 | 63 | $this->section = $section ?: new Section(); |
@@ -196,13 +196,13 @@ discard block |
||
| 196 | 196 | */ |
| 197 | 197 | private function doRender($file, $data) |
| 198 | 198 | { |
| 199 | - $this->view_data = array_merge($this->view_data, $data); |
|
| 199 | + $this->view_data = array_merge($this->view_data, $data); |
|
| 200 | 200 | if (is_array($file)) { |
| 201 | - foreach($file as $key => $val) { |
|
| 201 | + foreach ($file as $key => $val) { |
|
| 202 | 202 | $this->section->set($key, $val); |
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | - elseif(!$this->view_file = $this->getPath($file)) { |
|
| 205 | + elseif (!$this->view_file = $this->getPath($file)) { |
|
| 206 | 206 | return null; |
| 207 | 207 | } |
| 208 | 208 | else { |
@@ -140,7 +140,9 @@ discard block |
||
| 140 | 140 | */ |
| 141 | 141 | public function __get($name) |
| 142 | 142 | { |
| 143 | - if ($name === 'section') return $this->section; |
|
| 143 | + if ($name === 'section') { |
|
| 144 | + return $this->section; |
|
| 145 | + } |
|
| 144 | 146 | return $this->service($name); |
| 145 | 147 | } |
| 146 | 148 | |
@@ -201,11 +203,9 @@ discard block |
||
| 201 | 203 | foreach($file as $key => $val) { |
| 202 | 204 | $this->section->set($key, $val); |
| 203 | 205 | } |
| 204 | - } |
|
| 205 | - elseif(!$this->view_file = $this->getPath($file)) { |
|
| 206 | + } elseif(!$this->view_file = $this->getPath($file)) { |
|
| 206 | 207 | return null; |
| 207 | - } |
|
| 208 | - else { |
|
| 208 | + } else { |
|
| 209 | 209 | $this->setContent($this->renderViewFile()); |
| 210 | 210 | } |
| 211 | 211 | if (!isset($this->layout_file)) { |