diff --git a/cake/libs/cake_session.php b/cake/libs/cake_session.php index c590f28818b..91ed52f026f 100644 --- a/cake/libs/cake_session.php +++ b/cake/libs/cake_session.php @@ -393,9 +393,8 @@ public static function read($name = null) { * Returns all session variables. * * @return mixed Full $_SESSION array, or false on error. - * @access private */ - function __returnSessionVars() { + private static function __returnSessionVars() { if (!empty($_SESSION)) { return $_SESSION; } diff --git a/cake/libs/controller/cake_error_controller.php b/cake/libs/controller/cake_error_controller.php index 765e79f3061..4430248402a 100644 --- a/cake/libs/controller/cake_error_controller.php +++ b/cake/libs/controller/cake_error_controller.php @@ -26,7 +26,7 @@ class CakeErrorController extends AppController { function __construct() { parent::__construct(); $this->_set(Router::getPaths()); - $this->request = $this->params = Router::getRequest(false); + $this->request = Router::getRequest(false); $this->constructClasses(); $this->Components->trigger('initialize', array(&$this)); $this->_set(array('cacheAction' => false, 'viewPath' => 'errors')); diff --git a/cake/libs/debugger.php b/cake/libs/debugger.php index f07ab78c616..33f665a2c22 100644 --- a/cake/libs/debugger.php +++ b/cake/libs/debugger.php @@ -236,7 +236,7 @@ public static function log($var, $level = LOG_DEBUG) { * @param array $context Context * @return boolean true if error was handled */ - public function showError($code, $description, $file = null, $line = null, $context = null) { + public static function showError($code, $description, $file = null, $line = null, $context = null) { $_this = Debugger::getInstance(); if (empty($file)) { diff --git a/cake/libs/validation.php b/cake/libs/validation.php index 5af6db7488c..adda137c001 100644 --- a/cake/libs/validation.php +++ b/cake/libs/validation.php @@ -415,7 +415,8 @@ public static function extension($check, $extensions = array('gif', 'jpeg', 'png if (is_array($check)) { return self::extension(array_shift($check), $extensions); } - $extension = strtolower(array_pop(explode('.', $check))); + $pathSegments = explode('.', $check); + $extension = strtolower(array_pop($pathSegments)); foreach ($extensions as $value) { if ($extension == strtolower($value)) { return true; @@ -431,7 +432,7 @@ public static function extension($check, $extensions = array('gif', 'jpeg', 'png * @param string $ipVersion The IP Protocol version to validate against * @return boolean Success */ - public function ip($check, $type = 'both') { + public static function ip($check, $type = 'both') { $type = strtolower($type); $flags = array(); if ($type === 'ipv4' || $type === 'both') { diff --git a/cake/libs/xml.php b/cake/libs/xml.php index 160572b951a..0027d1631cc 100644 --- a/cake/libs/xml.php +++ b/cake/libs/xml.php @@ -182,7 +182,7 @@ public static function fromArray($input, $options = array()) { * @param string $format Either 'attribute' or 'tags'. This determines where nested keys go. * @return void */ - protected function _fromArray(&$dom, &$node, &$data, $format) { + protected static function _fromArray(&$dom, &$node, &$data, $format) { if (empty($data) || !is_array($data)) { return; } @@ -237,7 +237,7 @@ protected function _fromArray(&$dom, &$node, &$data, $format) { * @param array $data Array with informations to create childs * @return void */ - private function __createChild($data) { + private static function __createChild($data) { extract($data); $childNS = $childValue = null; if (is_array($value)) { diff --git a/cake/tests/cases/libs/set.test.php b/cake/tests/cases/libs/set.test.php index 1075b6cf762..a4d6a542739 100644 --- a/cake/tests/cases/libs/set.test.php +++ b/cake/tests/cases/libs/set.test.php @@ -2706,10 +2706,9 @@ function testApply() { /** * Helper method to test Set::apply() * - * @access protected * @return void */ - function _method($val1, $val2) { + static function _method($val1, $val2) { $val1 += $val2; return $val1; } diff --git a/cake/tests/cases/libs/validation.test.php b/cake/tests/cases/libs/validation.test.php index a794453d8c8..002902a9d4e 100644 --- a/cake/tests/cases/libs/validation.test.php +++ b/cake/tests/cases/libs/validation.test.php @@ -34,7 +34,7 @@ class CustomValidator { * @return boolean * @access public */ - function customValidate($check) { + static function customValidate($check) { return (bool)preg_match('/^[0-9]{3}$/', $check); } } @@ -53,7 +53,7 @@ class TestNlValidation { * @param string $check * @return void */ - function postal($check) { + static function postal($check) { return true; } /** @@ -61,7 +61,7 @@ function postal($check) { * * @return void */ - function ssn($check) { + static function ssn($check) { return true; } } @@ -80,7 +80,7 @@ class TestDeValidation { * @param string $check * @return void */ - function phone($check) { + static function phone($check) { return true; } }