From f014b91677d78b6235fb4127fd828ffb8ccaa67a Mon Sep 17 00:00:00 2001 From: Eder Soares Date: Tue, 28 Mar 2023 17:00:44 -0300 Subject: [PATCH 1/3] Add `laravel/pint` --- composer.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index c354d9e..b6264ec 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,8 @@ }, "require-dev": { "composer/composer": "^2.3.0", - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^9.5", + "laravel/pint": "^1.7" }, "autoload": { "psr-4": { @@ -33,11 +34,13 @@ "class": "Dex\\Composer\\PlugAndPlay\\PlugAndPlayPlugin" }, "scripts": { + "format": "vendor/bin/pint", "test": "vendor/bin/phpunit tests --colors", "test:coverage": "XDEBUG_MODE=coverage vendor/bin/phpunit --colors --coverage-html=.build/coverage", "test:coverage:open": "open .build/coverage/index.html" }, "scripts-descriptions": { + "format": "Format code", "test": "Runs package tests", "test:coverage": "Runs coverage", "test:coverage:open": "Open coverage report" From b637e32a77aab227b8272764b1d440e79b2d0c87 Mon Sep 17 00:00:00 2001 From: Eder Soares Date: Tue, 28 Mar 2023 17:03:59 -0300 Subject: [PATCH 2/3] Pint configuration --- pint.json | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 pint.json diff --git a/pint.json b/pint.json new file mode 100644 index 0000000..3a4ebe1 --- /dev/null +++ b/pint.json @@ -0,0 +1,6 @@ +{ + "preset": "psr12", + "rules": { + "concat_space": false + } +} From f6bfa35d7a5597e724bbad35dd5cf793b0d4aa54 Mon Sep 17 00:00:00 2001 From: Eder Soares Date: Tue, 28 Mar 2023 17:04:05 -0300 Subject: [PATCH 3/3] Format --- src/Commands/AddCommand.php | 3 ++- src/Commands/DumpAutoloadCommand.php | 3 ++- src/Commands/InitCommand.php | 3 ++- src/Commands/InstallCommand.php | 3 ++- src/Commands/PlugAndPlayCommand.php | 3 ++- src/Commands/UpdateCommand.php | 3 ++- src/PlugAndPlayInterface.php | 8 ++++---- tests/TestCase.php | 1 - 8 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/Commands/AddCommand.php b/src/Commands/AddCommand.php index 9ad3d33..228f608 100644 --- a/src/Commands/AddCommand.php +++ b/src/Commands/AddCommand.php @@ -10,7 +10,8 @@ class AddCommand extends BaseCommand { - use ComposerCreator, CommandNaming; + use ComposerCreator; + use CommandNaming; protected function configure(): void { diff --git a/src/Commands/DumpAutoloadCommand.php b/src/Commands/DumpAutoloadCommand.php index 5830a99..a6492fc 100644 --- a/src/Commands/DumpAutoloadCommand.php +++ b/src/Commands/DumpAutoloadCommand.php @@ -6,7 +6,8 @@ class DumpAutoloadCommand extends ComposerDumpAutoloadCommand { - use ComposerCreator, CommandNaming; + use ComposerCreator; + use CommandNaming; protected function configure(): void { diff --git a/src/Commands/InitCommand.php b/src/Commands/InitCommand.php index 428463a..cc354ad 100644 --- a/src/Commands/InitCommand.php +++ b/src/Commands/InitCommand.php @@ -8,7 +8,8 @@ class InitCommand extends BaseCommand { - use ComposerCreator, CommandNaming; + use ComposerCreator; + use CommandNaming; protected function configure(): void { diff --git a/src/Commands/InstallCommand.php b/src/Commands/InstallCommand.php index 8bbde50..8582a83 100644 --- a/src/Commands/InstallCommand.php +++ b/src/Commands/InstallCommand.php @@ -6,7 +6,8 @@ class InstallCommand extends ComposerInstallCommand { - use ComposerCreator, CommandNaming; + use ComposerCreator; + use CommandNaming; protected function configure(): void { diff --git a/src/Commands/PlugAndPlayCommand.php b/src/Commands/PlugAndPlayCommand.php index b58dc39..efdd531 100644 --- a/src/Commands/PlugAndPlayCommand.php +++ b/src/Commands/PlugAndPlayCommand.php @@ -8,7 +8,8 @@ class PlugAndPlayCommand extends BaseCommand { - use ComposerCreator, CommandNaming; + use ComposerCreator; + use CommandNaming; protected function configure(): void { diff --git a/src/Commands/UpdateCommand.php b/src/Commands/UpdateCommand.php index 01a8416..1c8ceaf 100644 --- a/src/Commands/UpdateCommand.php +++ b/src/Commands/UpdateCommand.php @@ -6,7 +6,8 @@ class UpdateCommand extends ComposerUpdateCommand { - use ComposerCreator, CommandNaming; + use ComposerCreator; + use CommandNaming; protected function configure(): void { diff --git a/src/PlugAndPlayInterface.php b/src/PlugAndPlayInterface.php index a3156a9..99b93db 100644 --- a/src/PlugAndPlayInterface.php +++ b/src/PlugAndPlayInterface.php @@ -4,11 +4,11 @@ interface PlugAndPlayInterface { - const FILENAME = 'packages/plug-and-play.json'; + public const FILENAME = 'packages/plug-and-play.json'; - const PACKAGES_FILE = 'packages/composer.json'; + public const PACKAGES_FILE = 'packages/composer.json'; - const PACKAGES_PATH = 'packages'; + public const PACKAGES_PATH = 'packages'; - const PATH = 'packages/*/*/composer.json'; + public const PATH = 'packages/*/*/composer.json'; } diff --git a/tests/TestCase.php b/tests/TestCase.php index e55155a..e2854d8 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -6,5 +6,4 @@ abstract class TestCase extends PHPUnitTestCase { - }