From 90ddb43632378522c28f2ae5602e0cfcebf3f1bf Mon Sep 17 00:00:00 2001 From: Val Bancer Date: Sun, 11 Nov 2018 16:15:55 +0100 Subject: [PATCH] Fix some PHP 7.3 errors --- lib/Cake/Console/Command/Task/ModelTask.php | 2 +- lib/Cake/Core/App.php | 2 +- lib/Cake/Model/Permission.php | 2 +- .../Case/Console/Command/Task/ExtractTaskTest.php | 12 ++++++------ lib/Cake/Utility/Debugger.php | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/Cake/Console/Command/Task/ModelTask.php b/lib/Cake/Console/Command/Task/ModelTask.php index 4619655f9..88be255ce 100644 --- a/lib/Cake/Console/Command/Task/ModelTask.php +++ b/lib/Cake/Console/Command/Task/ModelTask.php @@ -224,7 +224,7 @@ class ModelTask extends BakeTask { if (!array_key_exists('id', $fields)) { $primaryKey = $this->findPrimaryKey($fields); } - + $displayField = null; if ($knownToExist) { $displayField = $tempModel->hasField(array('name', 'title')); if (!$displayField) { diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php index 409eb1b45..5aeac3024 100644 --- a/lib/Cake/Core/App.php +++ b/lib/Cake/Core/App.php @@ -891,7 +891,7 @@ class App { /** * Increases the PHP "memory_limit" ini setting by the specified amount * in kilobytes - * + * * @param string $additionalKb Number in kilobytes * @return void */ diff --git a/lib/Cake/Model/Permission.php b/lib/Cake/Model/Permission.php index 617f00465..8014e61c1 100644 --- a/lib/Cake/Model/Permission.php +++ b/lib/Cake/Model/Permission.php @@ -146,7 +146,7 @@ class Permission extends AppModel { case -1: return false; case 0: - continue; + break; case 1: return true; } diff --git a/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php b/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php index 56eb15c65..5c5b0b3d4 100644 --- a/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php +++ b/lib/Cake/Test/Case/Console/Command/Task/ExtractTaskTest.php @@ -381,10 +381,10 @@ class ExtractTaskTest extends CakeTestCase { $this->Task->execute(); $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); - $pattern = preg_quote('#Model/PersisterOne.php:validation for field body#', '\\'); + $pattern = preg_quote('#Model/PersisterOne.php:validation for field body#', '/'); $this->assertRegExp($pattern, $result); $pattern = '#msgid "Post title is required"#'; @@ -430,10 +430,10 @@ class ExtractTaskTest extends CakeTestCase { $this->Task->execute(); $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); - $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); $pattern = '#msgid "Post title is required"#'; @@ -469,10 +469,10 @@ class ExtractTaskTest extends CakeTestCase { $this->Task->execute(); $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); - $pattern = preg_quote('#Model/TestPluginPost.php:validation for field body#', '\\'); + $pattern = preg_quote('#Model/TestPluginPost.php:validation for field body#', '/'); $this->assertRegExp($pattern, $result); $pattern = '#msgid "Post title is required"#'; diff --git a/lib/Cake/Utility/Debugger.php b/lib/Cake/Utility/Debugger.php index ba8a61fd9..ef906659e 100644 --- a/lib/Cake/Utility/Debugger.php +++ b/lib/Cake/Utility/Debugger.php @@ -252,7 +252,7 @@ class Debugger { } $data = compact( - 'level', 'error', 'code', 'description', 'file', 'path', 'line', 'context' + 'level', 'error', 'code', 'description', 'file', 'line', 'context' ); echo $self->outputError($data);