Fix some PHP 7.3 errors

This commit is contained in:
Val Bancer 2018-11-11 16:15:55 +01:00
parent dd9601d73f
commit 90ddb43632
5 changed files with 10 additions and 10 deletions

View file

@ -224,7 +224,7 @@ class ModelTask extends BakeTask {
if (!array_key_exists('id', $fields)) { if (!array_key_exists('id', $fields)) {
$primaryKey = $this->findPrimaryKey($fields); $primaryKey = $this->findPrimaryKey($fields);
} }
$displayField = null;
if ($knownToExist) { if ($knownToExist) {
$displayField = $tempModel->hasField(array('name', 'title')); $displayField = $tempModel->hasField(array('name', 'title'));
if (!$displayField) { if (!$displayField) {

View file

@ -146,7 +146,7 @@ class Permission extends AppModel {
case -1: case -1:
return false; return false;
case 0: case 0:
continue; break;
case 1: case 1:
return true; return true;
} }

View file

@ -381,10 +381,10 @@ class ExtractTaskTest extends CakeTestCase {
$this->Task->execute(); $this->Task->execute();
$result = file_get_contents($this->path . DS . 'default.pot'); $result = file_get_contents($this->path . DS . 'default.pot');
$pattern = preg_quote('#Model/PersisterOne.php:validation for field title#', '\\'); $pattern = preg_quote('#Model/PersisterOne.php:validation for field title#', '/');
$this->assertRegExp($pattern, $result); $this->assertRegExp($pattern, $result);
$pattern = preg_quote('#Model/PersisterOne.php:validation for field body#', '\\'); $pattern = preg_quote('#Model/PersisterOne.php:validation for field body#', '/');
$this->assertRegExp($pattern, $result); $this->assertRegExp($pattern, $result);
$pattern = '#msgid "Post title is required"#'; $pattern = '#msgid "Post title is required"#';
@ -430,10 +430,10 @@ class ExtractTaskTest extends CakeTestCase {
$this->Task->execute(); $this->Task->execute();
$result = file_get_contents($this->path . DS . 'test_plugin.pot'); $result = file_get_contents($this->path . DS . 'test_plugin.pot');
$pattern = preg_quote('#Plugin/TestPlugin/Model/TestPluginPost.php:validation for field title#', '\\'); $pattern = preg_quote('#Plugin/TestPlugin/Model/TestPluginPost.php:validation for field title#', '/');
$this->assertRegExp($pattern, $result); $this->assertRegExp($pattern, $result);
$pattern = preg_quote('#Plugin/TestPlugin/Model/TestPluginPost.php:validation for field body#', '\\'); $pattern = preg_quote('#Plugin/TestPlugin/Model/TestPluginPost.php:validation for field body#', '/');
$this->assertRegExp($pattern, $result); $this->assertRegExp($pattern, $result);
$pattern = '#msgid "Post title is required"#'; $pattern = '#msgid "Post title is required"#';
@ -469,10 +469,10 @@ class ExtractTaskTest extends CakeTestCase {
$this->Task->execute(); $this->Task->execute();
$result = file_get_contents($this->path . DS . 'test_plugin.pot'); $result = file_get_contents($this->path . DS . 'test_plugin.pot');
$pattern = preg_quote('#Model/TestPluginPost.php:validation for field title#', '\\'); $pattern = preg_quote('#Model/TestPluginPost.php:validation for field title#', '/');
$this->assertRegExp($pattern, $result); $this->assertRegExp($pattern, $result);
$pattern = preg_quote('#Model/TestPluginPost.php:validation for field body#', '\\'); $pattern = preg_quote('#Model/TestPluginPost.php:validation for field body#', '/');
$this->assertRegExp($pattern, $result); $this->assertRegExp($pattern, $result);
$pattern = '#msgid "Post title is required"#'; $pattern = '#msgid "Post title is required"#';

View file

@ -252,7 +252,7 @@ class Debugger {
} }
$data = compact( $data = compact(
'level', 'error', 'code', 'description', 'file', 'path', 'line', 'context' 'level', 'error', 'code', 'description', 'file', 'line', 'context'
); );
echo $self->outputError($data); echo $self->outputError($data);