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" 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 + } +} 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 { - }