Skip to content

Commit

Permalink
Fixing more strict warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Dec 13, 2010
1 parent 0ac8d04 commit 2fe6014
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 14 deletions.
3 changes: 1 addition & 2 deletions cake/libs/cake_session.php
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion cake/libs/controller/cake_error_controller.php
Expand Up @@ -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'));
Expand Down
2 changes: 1 addition & 1 deletion cake/libs/debugger.php
Expand Up @@ -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)) {
Expand Down
5 changes: 3 additions & 2 deletions cake/libs/validation.php
Expand Up @@ -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;
Expand All @@ -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') {
Expand Down
4 changes: 2 additions & 2 deletions cake/libs/xml.php
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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)) {
Expand Down
3 changes: 1 addition & 2 deletions cake/tests/cases/libs/set.test.php
Expand Up @@ -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;
}
Expand Down
8 changes: 4 additions & 4 deletions cake/tests/cases/libs/validation.test.php
Expand Up @@ -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);
}
}
Expand All @@ -53,15 +53,15 @@ class TestNlValidation {
* @param string $check
* @return void
*/
function postal($check) {
static function postal($check) {
return true;
}
/**
* ssn function for testing ssn pass through
*
* @return void
*/
function ssn($check) {
static function ssn($check) {
return true;
}
}
Expand All @@ -80,7 +80,7 @@ class TestDeValidation {
* @param string $check
* @return void
*/
function phone($check) {
static function phone($check) {
return true;
}
}
Expand Down

0 comments on commit 2fe6014

Please sign in to comment.