diff --git a/control/Controller.php b/control/Controller.php index 79fda01de..6cb92494a 100644 --- a/control/Controller.php +++ b/control/Controller.php @@ -576,7 +576,7 @@ class Controller extends RequestHandler implements TemplateGlobalProvider { $queryargs = array_merge($queryargs, $localargs); } if((is_string($arg) && $arg) || is_numeric($arg)) { - $arg = (string)$arg; + $arg = (string) $arg; if($result && substr($result,-1) != '/' && $arg[0] != '/') $result .= "/$arg"; else $result .= (substr($result, -1) == '/' && $arg[0] == '/') ? ltrim($arg, '/') : $arg; } diff --git a/control/Director.php b/control/Director.php index 2abf9bf30..0236f8a68 100644 --- a/control/Director.php +++ b/control/Director.php @@ -122,7 +122,7 @@ class Director implements TemplateGlobalProvider { : $_SERVER['REQUEST_METHOD'], $url, $_GET, - ArrayLib::array_merge_recursive((array)$_POST, (array)$_FILES), + ArrayLib::array_merge_recursive((array) $_POST, (array) $_FILES), @file_get_contents('php://input') ); @@ -295,9 +295,9 @@ class Director implements TemplateGlobalProvider { } // Replace the superglobals with appropriate test values - $_REQUEST = ArrayLib::array_merge_recursive((array)$getVars, (array)$postVars); - $_GET = (array)$getVars; - $_POST = (array)$postVars; + $_REQUEST = ArrayLib::array_merge_recursive((array) $getVars, (array) $postVars); + $_GET = (array) $getVars; + $_POST = (array) $postVars; $_SESSION = $session ? $session->inst_getAll() : array(); $_COOKIE = $cookieJar->getAll(false); Injector::inst()->registerService($cookieJar, 'Cookie_Backend'); diff --git a/control/HTTPRequest.php b/control/HTTPRequest.php index 3a8756d31..1aab8f26a 100644 --- a/control/HTTPRequest.php +++ b/control/HTTPRequest.php @@ -109,8 +109,8 @@ class SS_HTTPRequest implements ArrayAccess { $this->httpMethod = strtoupper(self::detect_method($httpMethod, $postVars)); $this->setUrl($url); - $this->getVars = (array)$getVars; - $this->postVars = (array)$postVars; + $this->getVars = (array) $getVars; + $this->postVars = (array) $postVars; $this->body = $body; } diff --git a/control/HTTPResponse.php b/control/HTTPResponse.php index 40d1db497..aefa6dde1 100644 --- a/control/HTTPResponse.php +++ b/control/HTTPResponse.php @@ -160,7 +160,7 @@ class SS_HTTPResponse { * @return SS_HTTPRequest $this */ public function setBody($body) { - $this->body = $body ? (string)$body : $body; // Don't type-cast false-ish values, eg null is null not '' + $this->body = $body ? (string) $body : $body; // Don't type-cast false-ish values, eg null is null not '' return $this; } diff --git a/control/PjaxResponseNegotiator.php b/control/PjaxResponseNegotiator.php index fa7782d41..5514326a0 100644 --- a/control/PjaxResponseNegotiator.php +++ b/control/PjaxResponseNegotiator.php @@ -87,7 +87,7 @@ class PjaxResponseNegotiator { foreach($fragments as $fragment) { if(isset($callbacks[$fragment])) { $res = call_user_func($callbacks[$fragment]); - $responseParts[$fragment] = $res ? (string)$res : $res; + $responseParts[$fragment] = $res ? (string) $res : $res; } else { throw new SS_HTTPResponse_Exception("X-Pjax = '$fragment' not supported for this URL.", 400); } diff --git a/control/RequestHandler.php b/control/RequestHandler.php index 1cbb41f56..41f5eba60 100644 --- a/control/RequestHandler.php +++ b/control/RequestHandler.php @@ -351,7 +351,7 @@ class RequestHandler extends ViewableData { if($action == 'index') return true; // Don't allow access to any non-public methods (inspect instance plus all extensions) - $insts = array_merge(array($this), (array)$this->getExtensionInstances()); + $insts = array_merge(array($this), (array) $this->getExtensionInstances()); foreach($insts as $inst) { if(!method_exists($inst, $action)) continue; $r = new ReflectionClass(get_class($inst)); @@ -389,7 +389,7 @@ class RequestHandler extends ViewableData { $action = strtolower($actionOrigCasing); $definingClass = null; - $insts = array_merge(array($this), (array)$this->getExtensionInstances()); + $insts = array_merge(array($this), (array) $this->getExtensionInstances()); foreach($insts as $inst) { if(!method_exists($inst, $action)) continue; $r = new ReflectionClass(get_class($inst)); diff --git a/control/Session.php b/control/Session.php index 0a7bdc59a..9725783b2 100644 --- a/control/Session.php +++ b/control/Session.php @@ -612,7 +612,7 @@ class Session { */ public static function set_timeout($timeout) { Deprecation::notice('4.0', 'Use the "Session.timeout" config setting instead'); - Config::inst()->update('Session', 'timeout', (int)$timeout); + Config::inst()->update('Session', 'timeout', (int) $timeout); } /**