@@ -27,7 +27,7 @@ discard block |
||
27 | 27 | private function renderFields($rendered, $fields) |
28 | 28 | { |
29 | 29 | foreach ($fields as $field) { |
30 | - if (! isset($field['name'])) { |
|
30 | + if (!isset($field['name'])) { |
|
31 | 31 | throw new ControlException("Field must have at least a name!"); |
32 | 32 | } |
33 | 33 | $fieldType = isset($field['type']) ? $field['type'] : 'text'; |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | private function renderButtons($rendered, $buttons) |
55 | 55 | { |
56 | 56 | foreach ($buttons as $button) { |
57 | - if (! isset($button['name'])) { |
|
57 | + if (!isset($button['name'])) { |
|
58 | 58 | throw new ControlException("Button must have at least a name!"); |
59 | 59 | } |
60 | 60 | $buttonType = isset($button['type']) ? $button['type'] : "submit"; |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | public function render(Request $request, $parameters = array()) |
77 | 77 | { |
78 | 78 | $contentPrefix = "/"; |
79 | - if (! is_null($request->getContextPrefix())) { |
|
79 | + if (!is_null($request->getContextPrefix())) { |
|
80 | 80 | $contentPrefix = $request->getContextPrefix(); |
81 | 81 | } |
82 | 82 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | $class = isset($field['class']) ? $field['class'] : $field['name']; |
36 | 36 | |
37 | 37 | $rendered .= sprintf('<input type="%s" id="%s" class="%s" name="%s"/>', |
38 | - $fieldType, $id, $class, $field['name']); |
|
38 | + $fieldType, $id, $class, $field['name']); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | return $rendered; |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $label = isset($button['label']) ? $button['label'] : $button['name']; |
65 | 65 | |
66 | 66 | $rendered .= sprintf('<button type="%s" id="%s" class="%s" name="%s">%s</button>', |
67 | - $buttonType, $id, $class, $button['name'], $label); |
|
67 | + $buttonType, $id, $class, $button['name'], $label); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | return $rendered; |
@@ -83,16 +83,16 @@ discard block |
||
83 | 83 | } |
84 | 84 | |
85 | 85 | $formAction = sprintf("%s%s/%s", $contentPrefix, isset($parameters['controller']) ? |
86 | - $parameters['controller'] : lcfirst($request->getController()), isset($parameters['action']) ? |
|
87 | - $parameters['action'] : lcfirst($request->getAction())); |
|
86 | + $parameters['controller'] : lcfirst($request->getController()), isset($parameters['action']) ? |
|
87 | + $parameters['action'] : lcfirst($request->getAction())); |
|
88 | 88 | |
89 | 89 | if (isset($parameters['formAction'])) { |
90 | 90 | $formAction = $parameters['formAction']; |
91 | 91 | } |
92 | 92 | |
93 | 93 | $rendered = sprintf('<form action="%s" method="%s"%s>', $formAction, isset($parameters['formMethod']) ? |
94 | - $parameters['formMethod'] : "POST", isset($parameters['formClass']) ? |
|
95 | - (sprintf(' class="%s"', $parameters['formClass'])) : ""); |
|
94 | + $parameters['formMethod'] : "POST", isset($parameters['formClass']) ? |
|
95 | + (sprintf(' class="%s"', $parameters['formClass'])) : ""); |
|
96 | 96 | |
97 | 97 | $rendered = $this->renderFields($rendered, $parameters['fields']); |
98 | 98 |
@@ -78,7 +78,7 @@ |
||
78 | 78 | * |
79 | 79 | * @see \Nkey\Caribu\Mvc\View\View::render() |
80 | 80 | */ |
81 | - abstract public function render(Response &$response, Request $request, $parameters = array()); |
|
81 | + abstract public function render(Response & $response, Request $request, $parameters = array()); |
|
82 | 82 | |
83 | 83 | /** |
84 | 84 | * Retrieve the settings from view |
@@ -120,8 +120,8 @@ discard block |
||
120 | 120 | final public function matchController($controller) |
121 | 121 | { |
122 | 122 | return (in_array($controller, $this->controllers) || |
123 | - in_array('any', $this->controllers) || |
|
124 | - count($this->controllers) == 0); |
|
123 | + in_array('any', $this->controllers) || |
|
124 | + count($this->controllers) == 0); |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
@@ -132,8 +132,8 @@ discard block |
||
132 | 132 | final public function matchAction($action) |
133 | 133 | { |
134 | 134 | return (in_array($action, $this->actions) || |
135 | - in_array('any', $this->actions) || |
|
136 | - count($this->actions) == 0); |
|
135 | + in_array('any', $this->actions) || |
|
136 | + count($this->actions) == 0); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
@@ -37,7 +37,7 @@ |
||
37 | 37 | * |
38 | 38 | * @see \Nkey\Caribu\Mvc\View\AbstractView::render() |
39 | 39 | */ |
40 | - public function render(Response &$response, Request $request, $parameters = array()) |
|
40 | + public function render(Response & $response, Request $request, $parameters = array()) |
|
41 | 41 | { |
42 | 42 | if ($response->getType() == 'text/html') { |
43 | 43 | $html = sprintf(" |
@@ -46,7 +46,7 @@ |
||
46 | 46 | if (null === $namespace) { |
47 | 47 | $this->sessionData = $_SESSION; |
48 | 48 | } else { |
49 | - if (! isset($_SESSION[$namespace])) { |
|
49 | + if (!isset($_SESSION[$namespace])) { |
|
50 | 50 | $_SESSION[$namespace] = array(); |
51 | 51 | } |
52 | 52 | $this->sessionData = $_SESSION[$namespace]; |
@@ -28,7 +28,7 @@ |
||
28 | 28 | * |
29 | 29 | * @return void |
30 | 30 | */ |
31 | - public function render(Response &$response, Request $request, $parameters = array()); |
|
31 | + public function render(Response & $response, Request $request, $parameters = array()); |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Retrieve the order of view in best-match list |
@@ -215,7 +215,7 @@ |
||
215 | 215 | $currentBody = $response->getBody(); |
216 | 216 | |
217 | 217 | if (! isset($this->viewParams[$controlIdentifier][$controlName]) |
218 | - || ! $view->hasControl($controlIdentifier)) { |
|
218 | + || ! $view->hasControl($controlIdentifier)) { |
|
219 | 219 | $response->setBody(str_replace($matches[0], '', $currentBody)); |
220 | 220 | continue; |
221 | 221 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | $param = $params[0]; |
82 | 82 | assert($param instanceof \ReflectionParameter); |
83 | - if (! ($class = $param->getClass()) || $class->getName() != 'Nkey\Caribu\Mvc\Controller\Request') { |
|
83 | + if (!($class = $param->getClass()) || $class->getName() != 'Nkey\Caribu\Mvc\Controller\Request') { |
|
84 | 84 | return false; |
85 | 85 | } |
86 | 86 | |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | return; |
107 | 107 | } |
108 | 108 | |
109 | - if (! $this->parseParameters($action)) { |
|
109 | + if (!$this->parseParameters($action)) { |
|
110 | 110 | return; |
111 | 111 | } |
112 | 112 | |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | * @param View $view |
206 | 206 | * The View instance to use for rendering |
207 | 207 | */ |
208 | - protected function addControls(Response &$response, Request $request, View $view) |
|
208 | + protected function addControls(Response & $response, Request $request, View $view) |
|
209 | 209 | { |
210 | 210 | $matches = array(); |
211 | 211 | |
@@ -214,8 +214,8 @@ discard block |
||
214 | 214 | $controlName = $matches[2]; |
215 | 215 | $currentBody = $response->getBody(); |
216 | 216 | |
217 | - if (! isset($this->viewParams[$controlIdentifier][$controlName]) |
|
218 | - || ! $view->hasControl($controlIdentifier)) { |
|
217 | + if (!isset($this->viewParams[$controlIdentifier][$controlName]) |
|
218 | + || !$view->hasControl($controlIdentifier)) { |
|
219 | 219 | $response->setBody(str_replace($matches[0], '', $currentBody)); |
220 | 220 | continue; |
221 | 221 | } |
@@ -318,21 +318,21 @@ discard block |
||
318 | 318 | */ |
319 | 319 | public function registerController($controller, $applicationName = 'default') |
320 | 320 | { |
321 | - if ( !$controller instanceof \Nkey\Caribu\Mvc\Controller\AbstractController ) { |
|
322 | - if (! class_exists($controller)) { |
|
323 | - throw new ControllerException("No such controller class {controller} found", array( |
|
324 | - 'controller' => $controller |
|
325 | - )); |
|
326 | - } |
|
327 | - $c = new $controller(); |
|
328 | - if (! ($c instanceof AbstractController)) { |
|
329 | - throw new ControllerException("Controller {controller} is not in application scope", array( |
|
330 | - 'controller' => $controller |
|
331 | - )); |
|
332 | - } |
|
333 | - } |
|
321 | + if ( !$controller instanceof \Nkey\Caribu\Mvc\Controller\AbstractController ) { |
|
322 | + if (! class_exists($controller)) { |
|
323 | + throw new ControllerException("No such controller class {controller} found", array( |
|
324 | + 'controller' => $controller |
|
325 | + )); |
|
326 | + } |
|
327 | + $c = new $controller(); |
|
328 | + if (! ($c instanceof AbstractController)) { |
|
329 | + throw new ControllerException("Controller {controller} is not in application scope", array( |
|
330 | + 'controller' => $controller |
|
331 | + )); |
|
332 | + } |
|
333 | + } |
|
334 | 334 | else { |
335 | - $c = $controller; |
|
335 | + $c = $controller; |
|
336 | 336 | } |
337 | 337 | $settings = $c->getControllerSettings(); |
338 | 338 | $this->controllers[$applicationName][$settings->getControllerSimpleName()] = $settings; |
@@ -375,35 +375,35 @@ discard block |
||
375 | 375 | )); |
376 | 376 | |
377 | 377 | if ( null != $this->router && $this->router->hasRoute($action) ) { |
378 | - $controllerInstance = $this->router->route($action, $request); |
|
379 | - $action = $request->getAction(); |
|
378 | + $controllerInstance = $this->router->route($action, $request); |
|
379 | + $action = $request->getAction(); |
|
380 | 380 | } |
381 | 381 | else { |
382 | - if (! isset($this->controllers[$applicationName][$controller])) { |
|
383 | - $this->getLogger()->error("[{remote}] No such controller {controller}", array( |
|
384 | - 'remote' => $request->getRemoteHost(), |
|
385 | - 'controller' => $controller |
|
386 | - )); |
|
387 | - $controller = 'Error'; |
|
388 | - $action = 'error'; |
|
389 | - } |
|
382 | + if (! isset($this->controllers[$applicationName][$controller])) { |
|
383 | + $this->getLogger()->error("[{remote}] No such controller {controller}", array( |
|
384 | + 'remote' => $request->getRemoteHost(), |
|
385 | + 'controller' => $controller |
|
386 | + )); |
|
387 | + $controller = 'Error'; |
|
388 | + $action = 'error'; |
|
389 | + } |
|
390 | 390 | |
391 | - $controllerInstance = $this->controllers[$applicationName][$controller]; |
|
392 | - assert($controllerInstance instanceof AbstractController); |
|
393 | - if (! $controllerInstance->hasAction($action)) { |
|
394 | - $this->getLogger()->error("[{remote}] No such action {action}", array( |
|
395 | - 'remote' => $request->getRemoteHost(), |
|
396 | - 'action' => $action |
|
397 | - )); |
|
398 | - $controllerInstance = $this->controllers[$applicationName]['Error']; |
|
399 | - $action = 'error'; |
|
400 | - } |
|
391 | + $controllerInstance = $this->controllers[$applicationName][$controller]; |
|
392 | + assert($controllerInstance instanceof AbstractController); |
|
393 | + if (! $controllerInstance->hasAction($action)) { |
|
394 | + $this->getLogger()->error("[{remote}] No such action {action}", array( |
|
395 | + 'remote' => $request->getRemoteHost(), |
|
396 | + 'action' => $action |
|
397 | + )); |
|
398 | + $controllerInstance = $this->controllers[$applicationName]['Error']; |
|
399 | + $action = 'error'; |
|
400 | + } |
|
401 | 401 | |
402 | - $this->getLogger()->debug("[{remote}] Routing request to {controller}:{action}", array( |
|
403 | - 'remote' => $request->getRemoteHost(), |
|
404 | - 'controller' => $controller, |
|
405 | - 'action' => $action |
|
406 | - )); |
|
402 | + $this->getLogger()->debug("[{remote}] Routing request to {controller}:{action}", array( |
|
403 | + 'remote' => $request->getRemoteHost(), |
|
404 | + 'controller' => $controller, |
|
405 | + 'action' => $action |
|
406 | + )); |
|
407 | 407 | } |
408 | 408 | |
409 | 409 | $view = $this->getViewBestMatch($request, $applicationName); |
@@ -467,9 +467,9 @@ discard block |
||
467 | 467 | */ |
468 | 468 | public function registerRouter(AbstractRouter $router) |
469 | 469 | { |
470 | - $this->router = $router; |
|
471 | - $this->router->setApplication($this); |
|
472 | - return $this; |
|
470 | + $this->router = $router; |
|
471 | + $this->router->setApplication($this); |
|
472 | + return $this; |
|
473 | 473 | } |
474 | 474 | |
475 | 475 | /** |
@@ -211,14 +211,14 @@ discard block |
||
211 | 211 | */ |
212 | 212 | public function registerView($view, $order = null, $applicationName = 'default') |
213 | 213 | { |
214 | - if (! class_exists($view)) { |
|
214 | + if (!class_exists($view)) { |
|
215 | 215 | throw new ViewException("No such view class {view} found", array( |
216 | 216 | 'view' => $view |
217 | 217 | )); |
218 | 218 | } |
219 | 219 | |
220 | 220 | $v = new $view(); |
221 | - if (! $v instanceof View) { |
|
221 | + if (!$v instanceof View) { |
|
222 | 222 | throw new ViewException("View {view} is not in application scope", array( |
223 | 223 | 'view' => $view |
224 | 224 | )); |
@@ -318,14 +318,14 @@ discard block |
||
318 | 318 | */ |
319 | 319 | public function registerController($controller, $applicationName = 'default') |
320 | 320 | { |
321 | - if ( !$controller instanceof \Nkey\Caribu\Mvc\Controller\AbstractController ) { |
|
322 | - if (! class_exists($controller)) { |
|
321 | + if (!$controller instanceof \Nkey\Caribu\Mvc\Controller\AbstractController) { |
|
322 | + if (!class_exists($controller)) { |
|
323 | 323 | throw new ControllerException("No such controller class {controller} found", array( |
324 | 324 | 'controller' => $controller |
325 | 325 | )); |
326 | 326 | } |
327 | 327 | $c = new $controller(); |
328 | - if (! ($c instanceof AbstractController)) { |
|
328 | + if (!($c instanceof AbstractController)) { |
|
329 | 329 | throw new ControllerException("Controller {controller} is not in application scope", array( |
330 | 330 | 'controller' => $controller |
331 | 331 | )); |
@@ -374,12 +374,12 @@ discard block |
||
374 | 374 | 'action' => $action |
375 | 375 | )); |
376 | 376 | |
377 | - if ( null != $this->router && $this->router->hasRoute($action) ) { |
|
377 | + if (null != $this->router && $this->router->hasRoute($action)) { |
|
378 | 378 | $controllerInstance = $this->router->route($action, $request); |
379 | 379 | $action = $request->getAction(); |
380 | 380 | } |
381 | 381 | else { |
382 | - if (! isset($this->controllers[$applicationName][$controller])) { |
|
382 | + if (!isset($this->controllers[$applicationName][$controller])) { |
|
383 | 383 | $this->getLogger()->error("[{remote}] No such controller {controller}", array( |
384 | 384 | 'remote' => $request->getRemoteHost(), |
385 | 385 | 'controller' => $controller |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | |
391 | 391 | $controllerInstance = $this->controllers[$applicationName][$controller]; |
392 | 392 | assert($controllerInstance instanceof AbstractController); |
393 | - if (! $controllerInstance->hasAction($action)) { |
|
393 | + if (!$controllerInstance->hasAction($action)) { |
|
394 | 394 | $this->getLogger()->error("[{remote}] No such action {action}", array( |
395 | 395 | 'remote' => $request->getRemoteHost(), |
396 | 396 | 'action' => $action |
@@ -330,8 +330,7 @@ discard block |
||
330 | 330 | 'controller' => $controller |
331 | 331 | )); |
332 | 332 | } |
333 | - } |
|
334 | - else { |
|
333 | + } else { |
|
335 | 334 | $c = $controller; |
336 | 335 | } |
337 | 336 | $settings = $c->getControllerSettings(); |
@@ -377,8 +376,7 @@ discard block |
||
377 | 376 | if ( null != $this->router && $this->router->hasRoute($action) ) { |
378 | 377 | $controllerInstance = $this->router->route($action, $request); |
379 | 378 | $action = $request->getAction(); |
380 | - } |
|
381 | - else { |
|
379 | + } else { |
|
382 | 380 | if (! isset($this->controllers[$applicationName][$controller])) { |
383 | 381 | $this->getLogger()->error("[{remote}] No such controller {controller}", array( |
384 | 382 | 'remote' => $request->getRemoteHost(), |
@@ -51,12 +51,12 @@ discard block |
||
51 | 51 | * @return array Parsed parts for later usage |
52 | 52 | */ |
53 | 53 | private static function parseUri(Request &$request, |
54 | - $uri, $defaultController, $defaultAction) |
|
54 | + $uri, $defaultController, $defaultAction) |
|
55 | 55 | { |
56 | 56 | // All beyond the context prefix is our application request uri |
57 | 57 | $contextUri = $uri; |
58 | 58 | if (null != $request->getContextPrefix() && '/' != $request->getContextPrefix()) { |
59 | - $contextUri = str_replace($request->getContextPrefix(), '', $uri); |
|
59 | + $contextUri = str_replace($request->getContextPrefix(), '', $uri); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | // Split parts |
@@ -102,10 +102,10 @@ discard block |
||
102 | 102 | * The destination parameter name |
103 | 103 | */ |
104 | 104 | private static function parseElement(Request &$req, |
105 | - $serverVars, $elementName, $paramName) |
|
105 | + $serverVars, $elementName, $paramName) |
|
106 | 106 | { |
107 | 107 | if (isset($serverVars[$elementName])) { |
108 | - $req->setParam( $paramName, $serverVars[$elementName] ); |
|
108 | + $req->setParam( $paramName, $serverVars[$elementName] ); |
|
109 | 109 | } |
110 | 110 | } |
111 | 111 |
@@ -19,14 +19,14 @@ discard block |
||
19 | 19 | * |
20 | 20 | * @param Request $request |
21 | 21 | */ |
22 | - private static function parseContextPrefix(Request &$request, $serverVars = array()) |
|
22 | + private static function parseContextPrefix(Request & $request, $serverVars = array()) |
|
23 | 23 | { |
24 | 24 | // Since apache 2.3.13 we have now an additional index which provides the context |
25 | 25 | if (isset($serverVars['CONTEXT_PREFIX']) && $serverVars['CONTEXT_PREFIX'] != '') { |
26 | - $request->setContextPrefix( $serverVars['CONTEXT_PREFIX'] . '/' ); |
|
26 | + $request->setContextPrefix($serverVars['CONTEXT_PREFIX'].'/'); |
|
27 | 27 | } elseif (isset($serverVars['REDIRECT_BASE'])) { |
28 | 28 | // Try to determine the context from redirect base |
29 | - $request->setContextPrefix ( $serverVars['REDIRECT_BASE'] ); |
|
29 | + $request->setContextPrefix($serverVars['REDIRECT_BASE']); |
|
30 | 30 | } elseif (isset($serverVars['SCRIPT_FILENAME']) && isset($serverVars['SCRIPT_NAME'])) { |
31 | 31 | // Fallback - get context out of script path |
32 | 32 | if (isset($serverVars['HTTP_HOST'])) { |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | * |
51 | 51 | * @return array Parsed parts for later usage |
52 | 52 | */ |
53 | - private static function parseUri(Request &$request, |
|
53 | + private static function parseUri(Request & $request, |
|
54 | 54 | $uri, $defaultController, $defaultAction) |
55 | 55 | { |
56 | 56 | // All beyond the context prefix is our application request uri |
@@ -70,19 +70,19 @@ discard block |
||
70 | 70 | |
71 | 71 | // Check if there was a controller requested |
72 | 72 | if (count($parts) > 0) { |
73 | - $request->setController( ucfirst(trim($parts[0])) ); |
|
73 | + $request->setController(ucfirst(trim($parts[0]))); |
|
74 | 74 | array_shift($parts); |
75 | - if (! $request->getController()) { |
|
76 | - $request->setController( $defaultController ); |
|
75 | + if (!$request->getController()) { |
|
76 | + $request->setController($defaultController); |
|
77 | 77 | } |
78 | 78 | } |
79 | 79 | |
80 | 80 | // Check if there was an action requested |
81 | 81 | if (count($parts) > 0) { |
82 | - $request->setAction( trim($parts[0]) ); |
|
82 | + $request->setAction(trim($parts[0])); |
|
83 | 83 | array_shift($parts); |
84 | - if (! $request->getAction()) { |
|
85 | - $request->setAction( $defaultAction ); |
|
84 | + if (!$request->getAction()) { |
|
85 | + $request->setAction($defaultAction); |
|
86 | 86 | } |
87 | 87 | } |
88 | 88 | |
@@ -101,11 +101,11 @@ discard block |
||
101 | 101 | * @param string $paramName |
102 | 102 | * The destination parameter name |
103 | 103 | */ |
104 | - private static function parseElement(Request &$req, |
|
104 | + private static function parseElement(Request & $req, |
|
105 | 105 | $serverVars, $elementName, $paramName) |
106 | 106 | { |
107 | 107 | if (isset($serverVars[$elementName])) { |
108 | - $req->setParam( $paramName, $serverVars[$elementName] ); |
|
108 | + $req->setParam($paramName, $serverVars[$elementName]); |
|
109 | 109 | } |
110 | 110 | } |
111 | 111 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | * @param array $serverVars |
118 | 118 | * The server variables provided by sapi |
119 | 119 | */ |
120 | - private static function parseParameters(Request &$req, $serverVars) |
|
120 | + private static function parseParameters(Request & $req, $serverVars) |
|
121 | 121 | { |
122 | 122 | self::parseElement($req, $serverVars, 'HTTP_ACCEPT', 'Accept'); |
123 | 123 | self::parseElement($req, $serverVars, 'HTTP_ACCEPT_LANGUAGE', 'Accept-Language'); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | * |
149 | 149 | * @param Request $request |
150 | 150 | */ |
151 | - private static function parseRemoteHost(Request &$request, $serverVars = array()) |
|
151 | + private static function parseRemoteHost(Request & $request, $serverVars = array()) |
|
152 | 152 | { |
153 | 153 | if (isset($serverVars['REMOTE_ADDR'])) { |
154 | 154 | $request->remoteHost = $serverVars['REMOTE_ADDR']; |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | * @param Request $request |
165 | 165 | * Request object to put the parameters in |
166 | 166 | */ |
167 | - private static function parseGetPostSessionCookie(Request &$request) |
|
167 | + private static function parseGetPostSessionCookie(Request & $request) |
|
168 | 168 | { |
169 | 169 | foreach ($_GET as $name => $value) { |
170 | 170 | $request->params[$name] = $value; |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | */ |
182 | 182 | public function setController($controller) |
183 | 183 | { |
184 | - $this->controller = strval($controller); |
|
184 | + $this->controller = strval($controller); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | /** |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | */ |
202 | 202 | public function setAction($action) |
203 | 203 | { |
204 | - $this->action = $action; |
|
204 | + $this->action = $action; |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | */ |
232 | 232 | public function setContextPrefix($prefix) |
233 | 233 | { |
234 | - $this->contextPrefix = strval($prefix); |
|
234 | + $this->contextPrefix = strval($prefix); |
|
235 | 235 | } |
236 | 236 | |
237 | 237 | /** |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | public static function parseFromServerRequest($serverVars, $defaultController = 'Index', $defaultAction = 'index') |
150 | 150 | { |
151 | - if (! isset($serverVars['REQUEST_URI'])) { |
|
151 | + if (!isset($serverVars['REQUEST_URI'])) { |
|
152 | 152 | throw new InvalidUrlException("No such uri provided"); |
153 | 153 | } |
154 | 154 | return self::parse($serverVars['REQUEST_URI'], $serverVars, $defaultController, $defaultAction); |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | switch ($typeOf) { |
273 | 273 | case 'bool': |
274 | 274 | case 'boolean': |
275 | - $result = function_exists('boolval') ? boolval($result) : (bool) $result; |
|
275 | + $result = function_exists('boolval') ? boolval($result) : (bool)$result; |
|
276 | 276 | break; |
277 | 277 | |
278 | 278 | case 'double': |