mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fixing more strict warnings.
This commit is contained in:
parent
0ac8d04241
commit
2fe60142f5
7 changed files with 13 additions and 14 deletions
|
@ -393,9 +393,8 @@ class CakeSession {
|
|||
* 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;
|
||||
}
|
||||
|
|
|
@ -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'));
|
||||
|
|
|
@ -236,7 +236,7 @@ class Debugger {
|
|||
* @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)) {
|
||||
|
|
|
@ -415,7 +415,8 @@ class Validation {
|
|||
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 @@ class Validation {
|
|||
* @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') {
|
||||
|
|
|
@ -182,7 +182,7 @@ class Xml {
|
|||
* @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 @@ class Xml {
|
|||
* @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)) {
|
||||
|
|
|
@ -2706,10 +2706,9 @@ class SetTest extends CakeTestCase {
|
|||
/**
|
||||
* Helper method to test Set::apply()
|
||||
*
|
||||
* @access protected
|
||||
* @return void
|
||||
*/
|
||||
function _method($val1, $val2) {
|
||||
static function _method($val1, $val2) {
|
||||
$val1 += $val2;
|
||||
return $val1;
|
||||
}
|
||||
|
|
|
@ -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 @@ class TestNlValidation {
|
|||
*
|
||||
* @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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue