adding a space before casting into a different type

This commit is contained in:
Peter Thaleikis 2015-09-28 22:21:02 +13:00
parent e2fbbda2fd
commit e6084b7ad2
7 changed files with 12 additions and 12 deletions

View File

@ -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;
}

View File

@ -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');

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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));

View File

@ -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);
}
/**