@@ -170,6 +170,9 @@ discard block |
||
170 | 170 | return false; |
171 | 171 | } |
172 | 172 | |
173 | + /** |
|
174 | + * @param boolean|string $layout |
|
175 | + */ |
|
173 | 176 | public function setLayout($layout) |
174 | 177 | { |
175 | 178 | |
@@ -211,6 +214,10 @@ discard block |
||
211 | 214 | * @return string processed content |
212 | 215 | */ |
213 | 216 | //@TODO: come back and clean up this and the way the view receives stuff |
217 | + |
|
218 | + /** |
|
219 | + * @param string|boolean $file |
|
220 | + */ |
|
214 | 221 | private function process($file) |
215 | 222 | { |
216 | 223 | ob_start(); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $this->view = $this->process($this->view); |
115 | 115 | } |
116 | 116 | |
117 | - if (! is_null($this->layout)) { |
|
117 | + if (!is_null($this->layout)) { |
|
118 | 118 | return $this->process($this->layout); |
119 | 119 | } else { |
120 | 120 | return $this->view; |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | } |
248 | 248 | |
249 | 249 | foreach ($sheets as $sheet) { |
250 | - $string .= '<link rel="stylesheet" href="' . $sheet .'">' . "\r\n"; |
|
250 | + $string .= '<link rel="stylesheet" href="' . $sheet . '">' . "\r\n"; |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | return $string; |
@@ -2,8 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace Zewa; |
4 | 4 | |
5 | -use Zewa\Exception\LookupException; |
|
6 | - |
|
7 | 5 | /** |
8 | 6 | * This class is the starting point for application |
9 | 7 | * |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | } |
189 | 189 | } |
190 | 190 | |
191 | - if(is_null($this->services)) { |
|
191 | + if (is_null($this->services)) { |
|
192 | 192 | $this->services = (object)[]; |
193 | 193 | } |
194 | 194 | } |
@@ -223,9 +223,9 @@ discard block |
||
223 | 223 | public function getConfiguration($config = null) |
224 | 224 | { |
225 | 225 | if ($config !== null) { |
226 | - if (! empty($this->configuration->$config)) { |
|
226 | + if (!empty($this->configuration->$config)) { |
|
227 | 227 | return $this->configuration->$config; |
228 | - } elseif (! empty($this->files{$config})) { |
|
228 | + } elseif (!empty($this->files{$config})) { |
|
229 | 229 | $vars = include $this->files{$config}; |
230 | 230 | |
231 | 231 | if ($vars === false) { |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $app = App::getInstance(); |
128 | 128 | $this->configuration = $app->getConfiguration(); |
129 | 129 | |
130 | - if( !empty($this->configuration->session) ) { |
|
130 | + if (!empty($this->configuration->session)) { |
|
131 | 131 | if ($this->configuration->session !== false && $this->configuration->session->flashdataId) { |
132 | 132 | $this->flashdataId = $this->configuration->session->flashdataId; |
133 | 133 | } |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | // iterate through all the entries |
173 | 173 | foreach ($this->flashdata as $variable => $data) { |
174 | 174 | // increment counter representing server requests |
175 | - $this->flashdata[$variable]['inc'] ++; |
|
175 | + $this->flashdata[$variable]['inc']++; |
|
176 | 176 | |
177 | 177 | // if we're past the first server request |
178 | 178 | if ($this->flashdata[$variable]['inc'] > 1) { |
@@ -352,9 +352,9 @@ discard block |
||
352 | 352 | |
353 | 353 | if (is_numeric($data)) { |
354 | 354 | if ((intval($data) === (int)trim($data, '-')) && strlen((string)(int)$data) === strlen($data)) { |
355 | - $data = (int) $data; |
|
355 | + $data = (int)$data; |
|
356 | 356 | } elseif ($data === (string)(float)$data) { |
357 | - $data = (float) $data; |
|
357 | + $data = (float)$data; |
|
358 | 358 | } |
359 | 359 | } else { |
360 | 360 | // $data = $this->purifier->purify($data); |
@@ -372,12 +372,12 @@ discard block |
||
372 | 372 | $container = $name . 'Container'; |
373 | 373 | $container = $this->$container; |
374 | 374 | |
375 | - $argument = ! empty($arguments[0]) ? $arguments[0] : false; |
|
375 | + $argument = !empty($arguments[0]) ? $arguments[0] : false; |
|
376 | 376 | |
377 | 377 | if ($argument === false && !empty($container)) { |
378 | 378 | return $container; |
379 | 379 | } |
380 | - if (! empty($container[$argument])) { |
|
380 | + if (!empty($container[$argument])) { |
|
381 | 381 | if (!is_array($container[$argument]) |
382 | 382 | && !is_object($container[$argument]) |
383 | 383 | && strlen($container[$argument]) > 0 |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | } |
389 | 389 | } |
390 | 390 | |
391 | - return ! empty($arguments[1]) ? $arguments[1] : false; |
|
391 | + return !empty($arguments[1]) ? $arguments[1] : false; |
|
392 | 392 | } |
393 | 393 | |
394 | 394 | throw new Exception\FunctionException('Method ' . $name . ' does not exist.'); |