From c890c4c3df565d7fc4a7ae2e0dfe8c6e2c4043fa Mon Sep 17 00:00:00 2001 From: Corey Taylor Date: Fri, 10 Apr 2020 16:37:21 -0500 Subject: [PATCH] Fixed CS errors. Added cs-check, cs-fix and test scripts --- composer.json | 14 +++++++++-- src/Cache/Engine/DebugEngine.php | 23 +++++++++---------- src/Controller/ComposerController.php | 2 +- src/DebugInclude.php | 1 - src/DebugMemory.php | 1 - src/DebugTimer.php | 1 - src/Log/Engine/DebugKitLog.php | 1 - src/Mailer/SentMailResult.php | 1 - src/Panel/CachePanel.php | 1 - src/Panel/DeprecationsPanel.php | 1 - src/Panel/EnvironmentPanel.php | 2 -- src/Panel/HistoryPanel.php | 1 - src/Panel/IncludePanel.php | 1 - src/Panel/LogPanel.php | 1 - src/Panel/PackagesPanel.php | 1 - src/Panel/RequestPanel.php | 1 - src/Panel/RoutesPanel.php | 1 - src/Panel/SqlLogPanel.php | 1 - src/Panel/VariablesPanel.php | 3 --- tests/TestCase/DebugIncludeTest.php | 1 - tests/TestCase/DebugMemoryTest.php | 1 - .../TestCase/Panel/DeprecationsPanelTest.php | 5 ++-- tests/TestCase/Panel/EnvironmentPanelTest.php | 1 - tests/TestCase/Panel/IncludePanelTest.php | 1 - tests/TestCase/Panel/LogPanelTest.php | 1 - tests/TestCase/Panel/PackagesPanelTest.php | 2 +- tests/TestCase/Panel/RoutesPanelTest.php | 1 - tests/TestCase/Panel/VariablesPanelTest.php | 1 - tests/test_app/Form/TestForm.php | 1 + .../Panel/PluginTestPanel.php | 1 - 30 files changed, 28 insertions(+), 46 deletions(-) diff --git a/composer.json b/composer.json index 0a94575a7..26c7f6088 100644 --- a/composer.json +++ b/composer.json @@ -51,6 +51,16 @@ "suggest": { "ext-pdo_sqlite": "DebugKit needs to store panel data in a database. SQLite is simple and easy to use." }, - "prefer-stable": true, - "minimum-stability": "dev" + "scripts": { + "cs-check": [ + "phpcs --colors --parallel=16 -p src/ tests/" + ], + "cs-fix": [ + "phpcbf --colors --parallel=16 -p src/ tests/" + ], + "test": [ + "phpunit" + ] + }, + "prefer-stable": true } diff --git a/src/Cache/Engine/DebugEngine.php b/src/Cache/Engine/DebugEngine.php index 2e09836de..ec9213e23 100644 --- a/src/Cache/Engine/DebugEngine.php +++ b/src/Cache/Engine/DebugEngine.php @@ -11,7 +11,6 @@ * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) * @link http://cakephp.org CakePHP(tm) Project * @license http://www.opensource.org/licenses/mit-license.php MIT License - * */ namespace DebugKit\Cache\Engine; @@ -143,7 +142,7 @@ protected function log(string $operation, float $duration, ?string $key = null): } /** - * {@inheritDoc} + * @inheritDoc */ public function set($key, $value, $ttl = null): bool { @@ -158,7 +157,7 @@ public function set($key, $value, $ttl = null): bool } /** - * {@inheritDoc} + * @inheritDoc */ public function setMultiple($data, $ttl = null): bool { @@ -173,7 +172,7 @@ public function setMultiple($data, $ttl = null): bool } /** - * {@inheritDoc} + * @inheritDoc */ public function get($key, $default = null) { @@ -192,7 +191,7 @@ public function get($key, $default = null) } /** - * {@inheritDoc} + * @inheritDoc */ public function getMultiple($keys, $default = null): iterable { @@ -207,7 +206,7 @@ public function getMultiple($keys, $default = null): iterable } /** - * {@inheritDoc} + * @inheritDoc */ public function increment(string $key, int $offset = 1) { @@ -222,7 +221,7 @@ public function increment(string $key, int $offset = 1) } /** - * {@inheritDoc} + * @inheritDoc */ public function decrement(string $key, int $offset = 1) { @@ -237,7 +236,7 @@ public function decrement(string $key, int $offset = 1) } /** - * {@inheritDoc} + * @inheritDoc */ public function delete($key): bool { @@ -252,7 +251,7 @@ public function delete($key): bool } /** - * {@inheritDoc} + * @inheritDoc */ public function deleteMultiple($data): bool { @@ -267,7 +266,7 @@ public function deleteMultiple($data): bool } /** - * {@inheritDoc} + * @inheritDoc */ public function clear(): bool { @@ -282,7 +281,7 @@ public function clear(): bool } /** - * {@inheritDoc} + * @inheritDoc */ public function groups(): array { @@ -316,7 +315,7 @@ public function setConfig($key, $value = null, $merge = true) } /** - * {@inheritDoc} + * @inheritDoc */ public function clearGroup(string $group): bool { diff --git a/src/Controller/ComposerController.php b/src/Controller/ComposerController.php index 29c18a1ca..f26d379d6 100644 --- a/src/Controller/ComposerController.php +++ b/src/Controller/ComposerController.php @@ -26,7 +26,7 @@ class ComposerController extends DebugKitController { /** - * {@inheritDoc} + * @inheritDoc */ public function initialize(): void { diff --git a/src/DebugInclude.php b/src/DebugInclude.php index b96690283..2c1b71061 100644 --- a/src/DebugInclude.php +++ b/src/DebugInclude.php @@ -19,7 +19,6 @@ /** * Contains methods for Providing list of files. - * */ class DebugInclude { diff --git a/src/DebugMemory.php b/src/DebugMemory.php index 950c540f2..221ca650f 100644 --- a/src/DebugMemory.php +++ b/src/DebugMemory.php @@ -19,7 +19,6 @@ /** * Contains methods for Profiling memory usage. - * */ class DebugMemory { diff --git a/src/DebugTimer.php b/src/DebugTimer.php index 299daf852..76a5cc9eb 100644 --- a/src/DebugTimer.php +++ b/src/DebugTimer.php @@ -19,7 +19,6 @@ /** * Contains methods for Profiling and creating timers. - * */ class DebugTimer { diff --git a/src/Log/Engine/DebugKitLog.php b/src/Log/Engine/DebugKitLog.php index 3df9533de..4e47cfc22 100644 --- a/src/Log/Engine/DebugKitLog.php +++ b/src/Log/Engine/DebugKitLog.php @@ -18,7 +18,6 @@ /** * A CakeLog listener which saves having to munge files or other configured loggers. - * */ class DebugKitLog extends BaseLog { diff --git a/src/Mailer/SentMailResult.php b/src/Mailer/SentMailResult.php index 5aaac42e7..d15674a0e 100644 --- a/src/Mailer/SentMailResult.php +++ b/src/Mailer/SentMailResult.php @@ -16,7 +16,6 @@ /** * Represents the result of an already sent email - * */ class SentMailResult extends AbstractResult { diff --git a/src/Panel/CachePanel.php b/src/Panel/CachePanel.php index cf36fc198..70f9f9e91 100644 --- a/src/Panel/CachePanel.php +++ b/src/Panel/CachePanel.php @@ -11,7 +11,6 @@ * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) * @link http://cakephp.org CakePHP(tm) Project * @license http://www.opensource.org/licenses/mit-license.php MIT License - * */ namespace DebugKit\Panel; diff --git a/src/Panel/DeprecationsPanel.php b/src/Panel/DeprecationsPanel.php index 314ac54a7..92bda2459 100644 --- a/src/Panel/DeprecationsPanel.php +++ b/src/Panel/DeprecationsPanel.php @@ -21,7 +21,6 @@ /** * Provides a list of deprecated methods for the current request - * */ class DeprecationsPanel extends DebugPanel { diff --git a/src/Panel/EnvironmentPanel.php b/src/Panel/EnvironmentPanel.php index 6745420d2..23433342a 100644 --- a/src/Panel/EnvironmentPanel.php +++ b/src/Panel/EnvironmentPanel.php @@ -11,7 +11,6 @@ * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) * @link http://cakephp.org CakePHP(tm) Project * @license http://www.opensource.org/licenses/mit-license.php MIT License - * */ namespace DebugKit\Panel; @@ -21,7 +20,6 @@ /** * Provides information about your PHP and CakePHP environment to assist with debugging. - * */ class EnvironmentPanel extends DebugPanel { diff --git a/src/Panel/HistoryPanel.php b/src/Panel/HistoryPanel.php index 6d0f78fc2..7ce0c8bdb 100644 --- a/src/Panel/HistoryPanel.php +++ b/src/Panel/HistoryPanel.php @@ -19,7 +19,6 @@ /** * Provides debug information on previous requests. - * */ class HistoryPanel extends DebugPanel { diff --git a/src/Panel/IncludePanel.php b/src/Panel/IncludePanel.php index 54a7ca042..9fc6211cc 100644 --- a/src/Panel/IncludePanel.php +++ b/src/Panel/IncludePanel.php @@ -21,7 +21,6 @@ /** * Provides a list of included files for the current request - * */ class IncludePanel extends DebugPanel { diff --git a/src/Panel/LogPanel.php b/src/Panel/LogPanel.php index 61709f550..3aa23a69e 100644 --- a/src/Panel/LogPanel.php +++ b/src/Panel/LogPanel.php @@ -19,7 +19,6 @@ /** * Log Panel - Reads log entries made this request. - * */ class LogPanel extends DebugPanel { diff --git a/src/Panel/PackagesPanel.php b/src/Panel/PackagesPanel.php index b20a3d368..f5af7950f 100644 --- a/src/Panel/PackagesPanel.php +++ b/src/Panel/PackagesPanel.php @@ -20,7 +20,6 @@ /** * Packages Panel - Reads all installed packages in the project. - * */ class PackagesPanel extends DebugPanel { diff --git a/src/Panel/RequestPanel.php b/src/Panel/RequestPanel.php index 28d3066ae..695fb380b 100644 --- a/src/Panel/RequestPanel.php +++ b/src/Panel/RequestPanel.php @@ -19,7 +19,6 @@ /** * Provides debug information on the Current request params. - * */ class RequestPanel extends DebugPanel { diff --git a/src/Panel/RoutesPanel.php b/src/Panel/RoutesPanel.php index db63a3061..96db53918 100644 --- a/src/Panel/RoutesPanel.php +++ b/src/Panel/RoutesPanel.php @@ -11,7 +11,6 @@ * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) * @link http://cakephp.org CakePHP(tm) Project * @license http://www.opensource.org/licenses/mit-license.php MIT License - * */ namespace DebugKit\Panel; diff --git a/src/Panel/SqlLogPanel.php b/src/Panel/SqlLogPanel.php index 59b792f87..55781842b 100644 --- a/src/Panel/SqlLogPanel.php +++ b/src/Panel/SqlLogPanel.php @@ -24,7 +24,6 @@ /** * Provides debug information on the SQL logs and provides links to an ajax explain interface. - * */ class SqlLogPanel extends DebugPanel { diff --git a/src/Panel/VariablesPanel.php b/src/Panel/VariablesPanel.php index 46f80d286..6eb30d68a 100644 --- a/src/Panel/VariablesPanel.php +++ b/src/Panel/VariablesPanel.php @@ -31,7 +31,6 @@ /** * Provides debug information on the View variables. - * */ class VariablesPanel extends DebugPanel { @@ -39,7 +38,6 @@ class VariablesPanel extends DebugPanel * Extracts nested validation errors * * @param \Cake\Datasource\EntityInterface $entity Entity to extract - * * @return array */ protected function _getErrors(EntityInterface $entity) @@ -68,7 +66,6 @@ protected function _getErrors(EntityInterface $entity) * * @param callable $walker The walker to apply on the debug info array. * @param object $item The item whose debug info to retrieve. - * * @return array|string */ protected function _walkDebugInfo(callable $walker, $item) diff --git a/tests/TestCase/DebugIncludeTest.php b/tests/TestCase/DebugIncludeTest.php index 512d933a2..a5b95c00c 100644 --- a/tests/TestCase/DebugIncludeTest.php +++ b/tests/TestCase/DebugIncludeTest.php @@ -19,7 +19,6 @@ /** * Class DebugInclude test - * */ class DebugIncludeTest extends TestCase { diff --git a/tests/TestCase/DebugMemoryTest.php b/tests/TestCase/DebugMemoryTest.php index 288d1c740..708dba732 100644 --- a/tests/TestCase/DebugMemoryTest.php +++ b/tests/TestCase/DebugMemoryTest.php @@ -19,7 +19,6 @@ /** * Class DebugMemoryTest - * */ class DebugMemoryTest extends TestCase { diff --git a/tests/TestCase/Panel/DeprecationsPanelTest.php b/tests/TestCase/Panel/DeprecationsPanelTest.php index 8c5eece55..fb589a0e6 100644 --- a/tests/TestCase/Panel/DeprecationsPanelTest.php +++ b/tests/TestCase/Panel/DeprecationsPanelTest.php @@ -20,7 +20,6 @@ /** * Class DeprecationsPanelTest - * */ class DeprecationsPanelTest extends TestCase { @@ -67,12 +66,12 @@ public function testShutdown() $error = $data['plugins']['DebugKit'][0]; $this->assertStringContainsString('Something going away', $error['message']); $this->assertEquals('DebugKit/tests/TestCase/Panel/DeprecationsPanelTest.php', $error['niceFile']); - $this->assertEquals(47, $error['line']); + $this->assertEquals(46, $error['line']); $error = $data['plugins']['DebugKit'][2]; $this->assertStringContainsString('Raw error', $error['message']); $this->assertEquals('DebugKit/tests/TestCase/Panel/DeprecationsPanelTest.php', $error['niceFile']); - $this->assertEquals(49, $error['line']); + $this->assertEquals(48, $error['line']); } public function testSummary() diff --git a/tests/TestCase/Panel/EnvironmentPanelTest.php b/tests/TestCase/Panel/EnvironmentPanelTest.php index 5e6e306b7..8bd71cea9 100644 --- a/tests/TestCase/Panel/EnvironmentPanelTest.php +++ b/tests/TestCase/Panel/EnvironmentPanelTest.php @@ -20,7 +20,6 @@ /** * Class EnvironmentPanelTest - * */ class EnvironmentPanelTest extends TestCase { diff --git a/tests/TestCase/Panel/IncludePanelTest.php b/tests/TestCase/Panel/IncludePanelTest.php index ed11eae27..38de1d137 100644 --- a/tests/TestCase/Panel/IncludePanelTest.php +++ b/tests/TestCase/Panel/IncludePanelTest.php @@ -20,7 +20,6 @@ /** * Class IncludePanelTest - * */ class IncludePanelTest extends TestCase { diff --git a/tests/TestCase/Panel/LogPanelTest.php b/tests/TestCase/Panel/LogPanelTest.php index 4da128ffb..875a92c3b 100644 --- a/tests/TestCase/Panel/LogPanelTest.php +++ b/tests/TestCase/Panel/LogPanelTest.php @@ -21,7 +21,6 @@ /** * Class LogPanelTest - * */ class LogPanelTest extends TestCase { diff --git a/tests/TestCase/Panel/PackagesPanelTest.php b/tests/TestCase/Panel/PackagesPanelTest.php index f2a61f08d..1c112d1d0 100644 --- a/tests/TestCase/Panel/PackagesPanelTest.php +++ b/tests/TestCase/Panel/PackagesPanelTest.php @@ -20,7 +20,6 @@ /** * Class PackagesPanelTest - * */ class PackagesPanelTest extends TestCase { @@ -42,6 +41,7 @@ public function setUp(): void /** * Packages view variables provider + * * @return array */ public function packagesProvider() diff --git a/tests/TestCase/Panel/RoutesPanelTest.php b/tests/TestCase/Panel/RoutesPanelTest.php index ca8bc63b3..0fee3273d 100644 --- a/tests/TestCase/Panel/RoutesPanelTest.php +++ b/tests/TestCase/Panel/RoutesPanelTest.php @@ -21,7 +21,6 @@ /** * Class RoutesPanelTest - * */ class RoutesPanelTest extends TestCase { diff --git a/tests/TestCase/Panel/VariablesPanelTest.php b/tests/TestCase/Panel/VariablesPanelTest.php index 5601108a9..15709f6f7 100644 --- a/tests/TestCase/Panel/VariablesPanelTest.php +++ b/tests/TestCase/Panel/VariablesPanelTest.php @@ -23,7 +23,6 @@ /** * Class VariablesPanelTest - * */ class VariablesPanelTest extends TestCase { diff --git a/tests/test_app/Form/TestForm.php b/tests/test_app/Form/TestForm.php index e2178a372..776a07b69 100644 --- a/tests/test_app/Form/TestForm.php +++ b/tests/test_app/Form/TestForm.php @@ -9,6 +9,7 @@ /** * Class TestForm + * * @package DebugKit\TestApp\Form */ class TestForm extends Form diff --git a/tests/test_app/Plugin/DebugkitTestPlugin/Panel/PluginTestPanel.php b/tests/test_app/Plugin/DebugkitTestPlugin/Panel/PluginTestPanel.php index bd83a5297..de8812d8e 100644 --- a/tests/test_app/Plugin/DebugkitTestPlugin/Panel/PluginTestPanel.php +++ b/tests/test_app/Plugin/DebugkitTestPlugin/Panel/PluginTestPanel.php @@ -22,7 +22,6 @@ /** * Class PluginTestPanel - * */ class PluginTestPanel extends DebugPanel