mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Updating for PHP5.4
- Fixing strict errors. - Fixing call time pass by reference as its been removed in PHP5.4 - Fix assign new as a reference, which has been removed.
This commit is contained in:
parent
0c0bb60486
commit
0a0a09920b
15 changed files with 30 additions and 50 deletions
|
@ -81,7 +81,8 @@ class CommandListShell extends Shell {
|
|||
protected function _getShellList() {
|
||||
$shellList = array();
|
||||
|
||||
$shells = App::objects('file', App::core('Console/Command'));
|
||||
$corePath = App::core('Console/Command');
|
||||
$shells = App::objects('file', $corePath[0]);
|
||||
$shellList = $this->_appendShells('CORE', $shells, $shellList);
|
||||
|
||||
$appShells = App::objects('Console/Command', null, false);
|
||||
|
|
|
@ -546,9 +546,10 @@ class CakeSchema extends Object {
|
|||
$difference[$key] = $value;
|
||||
continue;
|
||||
}
|
||||
$compare = strval($value);
|
||||
$correspondingValue = strval($correspondingValue);
|
||||
if ($compare === $correspondingValue) {
|
||||
if (is_array($value) && is_array($correspondingValue)) {
|
||||
continue;
|
||||
}
|
||||
if ($value === $correspondingValue) {
|
||||
continue;
|
||||
}
|
||||
$difference[$key] = $value;
|
||||
|
|
|
@ -40,23 +40,6 @@ class ParamTestComponent extends Component {
|
|||
* @var array
|
||||
*/
|
||||
public $components = array('Banana' => array('config' => 'value'));
|
||||
|
||||
/**
|
||||
* initialize method
|
||||
*
|
||||
* @param mixed $controller
|
||||
* @param mixed $settings
|
||||
* @return void
|
||||
*/
|
||||
public function initialize(&$controller, $settings) {
|
||||
foreach ($settings as $key => $value) {
|
||||
if (is_numeric($key)) {
|
||||
$this->{$value} = true;
|
||||
} else {
|
||||
$this->{$key} = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -109,7 +92,7 @@ class AppleComponent extends Component {
|
|||
* @param mixed $controller
|
||||
* @return void
|
||||
*/
|
||||
public function startup(&$controller) {
|
||||
public function startup($controller) {
|
||||
$this->testName = $controller->name;
|
||||
}
|
||||
}
|
||||
|
@ -134,7 +117,7 @@ class OrangeComponent extends Component {
|
|||
* @param mixed $controller
|
||||
* @return void
|
||||
*/
|
||||
public function initialize(&$controller) {
|
||||
public function initialize($controller) {
|
||||
$this->Controller = $controller;
|
||||
$this->Banana->testField = 'OrangeField';
|
||||
}
|
||||
|
@ -145,7 +128,7 @@ class OrangeComponent extends Component {
|
|||
* @param Controller $controller
|
||||
* @return string
|
||||
*/
|
||||
public function startup(&$controller) {
|
||||
public function startup($controller) {
|
||||
$controller->foo = 'pass';
|
||||
}
|
||||
}
|
||||
|
@ -170,7 +153,7 @@ class BananaComponent extends Component {
|
|||
* @param Controller $controller
|
||||
* @return string
|
||||
*/
|
||||
public function startup(&$controller) {
|
||||
public function startup($controller) {
|
||||
$controller->bar = 'fail';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ class ControllerPost extends CakeTestModel {
|
|||
* @param array $options
|
||||
* @return void
|
||||
*/
|
||||
public function find($type, $options = array()) {
|
||||
public function find($type = 'first', $options = array()) {
|
||||
if ($type == 'popular') {
|
||||
$conditions = array($this->name . '.' . $this->primaryKey .' > ' => '1');
|
||||
$options = Set::merge($options, compact('conditions'));
|
||||
|
|
|
@ -26,15 +26,6 @@ App::uses('PagesController', 'Controller');
|
|||
*/
|
||||
class PagesControllerTest extends CakeTestCase {
|
||||
|
||||
/**
|
||||
* endTest method
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function endTest() {
|
||||
App::build();
|
||||
}
|
||||
|
||||
/**
|
||||
* testDisplay method
|
||||
*
|
||||
|
|
|
@ -87,12 +87,12 @@ class ScaffoldMockControllerWithFields extends Controller {
|
|||
class TestScaffoldMock extends Scaffold {
|
||||
|
||||
/**
|
||||
* Overload __scaffold
|
||||
* Overload _scaffold
|
||||
*
|
||||
* @param unknown_type $params
|
||||
*/
|
||||
function _scaffold($params) {
|
||||
$this->_params = $params;
|
||||
function _scaffold(CakeRequest $request) {
|
||||
$this->_params = $request;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -64,7 +64,7 @@ class BlueberryComponent extends Component {
|
|||
*
|
||||
* @return void
|
||||
*/
|
||||
public function initialize(&$controller) {
|
||||
public function initialize($controller) {
|
||||
$this->testName = 'BlueberryComponent';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3305,9 +3305,9 @@ class ContainableBehaviorTest extends CakeTestCase {
|
|||
|
||||
$this->assertTrue(empty($this->Article->hasMany['ArticlesTag']));
|
||||
|
||||
$this->JoinA =& ClassRegistry::init('JoinA');
|
||||
$this->JoinB =& ClassRegistry::init('JoinB');
|
||||
$this->JoinC =& ClassRegistry::init('JoinC');
|
||||
$this->JoinA = ClassRegistry::init('JoinA');
|
||||
$this->JoinB = ClassRegistry::init('JoinB');
|
||||
$this->JoinC = ClassRegistry::init('JoinC');
|
||||
|
||||
$this->JoinA->Behaviors->attach('Containable');
|
||||
$this->JoinB->Behaviors->attach('Containable');
|
||||
|
|
|
@ -955,7 +955,7 @@ class CakeSchemaTest extends CakeTestCase {
|
|||
)
|
||||
)
|
||||
);
|
||||
$this->assertEqual($compare, $expected);
|
||||
$this->assertEquals($expected, $compare);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -43,7 +43,7 @@ class DboPostgresTestDb extends Postgres {
|
|||
* @param mixed $sql
|
||||
* @return void
|
||||
*/
|
||||
function _execute($sql, $params = array()) {
|
||||
function _execute($sql, $params = array(), $prepareOptions = array()) {
|
||||
$this->simulated[] = $sql;
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ class DboSqliteTestDb extends Sqlite {
|
|||
* @param mixed $sql
|
||||
* @return void
|
||||
*/
|
||||
function _execute($sql, $params = array()) {
|
||||
function _execute($sql, $params = array(), $prepareOptions = array()) {
|
||||
$this->simulated[] = $sql;
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -48,9 +48,11 @@ class SqlserverTestDb extends Sqlserver {
|
|||
* execute method
|
||||
*
|
||||
* @param mixed $sql
|
||||
* @param mixed $params
|
||||
* @param mixed $prepareOptions
|
||||
* @return mixed
|
||||
*/
|
||||
protected function _execute($sql) {
|
||||
protected function _execute($sql, $params = array(), $prepareOptions = array()) {
|
||||
$this->simulated[] = $sql;
|
||||
return empty($this->executeResultsStack) ? null : array_pop($this->executeResultsStack);
|
||||
}
|
||||
|
|
|
@ -33,10 +33,10 @@ class DboTestSource extends DboSource {
|
|||
}
|
||||
|
||||
public function mergeAssociation(&$data, &$merge, $association, $type, $selfJoin = false) {
|
||||
return parent::_mergeAssociation(&$data, &$merge, $association, $type, $selfJoin);
|
||||
return parent::_mergeAssociation($data, $merge, $association, $type, $selfJoin);
|
||||
}
|
||||
|
||||
public function setConfig($config) {
|
||||
public function setConfig($config = array()) {
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ class DigestHttpSocket extends HttpSocket {
|
|||
* @param mixed $request
|
||||
* @return void
|
||||
*/
|
||||
public function request($request) {
|
||||
public function request($request = array()) {
|
||||
if ($request === false) {
|
||||
if (isset($this->response['header']['WWW-Authenticate'])) {
|
||||
unset($this->response['header']['WWW-Authenticate']);
|
||||
|
|
|
@ -42,6 +42,7 @@ class SessionHelperTest extends CakeTestCase {
|
|||
|
||||
if (!CakeSession::started()) {
|
||||
CakeSession::start();
|
||||
var_dump('session was not started');
|
||||
}
|
||||
|
||||
$_SESSION = array(
|
||||
|
@ -70,6 +71,7 @@ class SessionHelperTest extends CakeTestCase {
|
|||
),
|
||||
'Deeply' => array('nested' => array('key' => 'value')),
|
||||
);
|
||||
var_dump($_SESSION);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue