From 44cf42f5811cd8c12f795651c7f5cef1b709839b Mon Sep 17 00:00:00 2001 From: Schelde Date: Mon, 9 Oct 2023 08:22:44 +0200 Subject: [PATCH] Fix: namespace and service provider (#7) * Added mac :DS_Store files to gitignore * Added: Service Provider with package discovery in composer.json * Fixed: Command being in correct namespace for following PSR-4 * Fixed: Naming of import for command in service provider * Removed: Registering its own service provider. no need after adding extra step in composer * Solves #6 --------- Co-authored-by: Jonas Schelde --- .gitignore | 1 + Makefile | 4 ++++ composer.json | 17 +++++++++++++---- src/Commands/TestCommand.php | 4 ++-- src/LaravelPareto.php | 7 ------- src/ServiceProvider.php | 28 ++++++++++++++++++++++++++++ 6 files changed, 48 insertions(+), 13 deletions(-) create mode 100644 Makefile delete mode 100755 src/LaravelPareto.php create mode 100644 src/ServiceProvider.php diff --git a/.gitignore b/.gitignore index 841e6e5..a816169 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ psalm.xml vendor .php-cs-fixer.cache +.DS_Store diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..c94ed92 --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +shell:=/bin/bash + +composer_install: + @php81 composer install diff --git a/composer.json b/composer.json index 351d7bb..1bab9ea 100644 --- a/composer.json +++ b/composer.json @@ -19,8 +19,10 @@ }, "require-dev": { "pestphp/pest": "^2.0", - "laravel/pint": "^2.3", - "spatie/ray": "^1.28" + "laravel/pint": "^v1.13.2", + "spatie/ray": "^1.28", + "illuminate/support": "^9.21|^10.0", + "illuminate/console": "^v9.21|^v10.0" }, "autoload": { "psr-4": { @@ -45,5 +47,12 @@ } }, "minimum-stability": "dev", - "prefer-stable": true -} \ No newline at end of file + "prefer-stable": true, + "extra": { + "laravel": { + "providers": [ + "EmilHorlyck\\LaravelPareto\\ServiceProvider" + ] + } + } +} diff --git a/src/Commands/TestCommand.php b/src/Commands/TestCommand.php index bbab610..3be0721 100644 --- a/src/Commands/TestCommand.php +++ b/src/Commands/TestCommand.php @@ -1,6 +1,6 @@ info('Test command'); + $this->info('Test command'); } } diff --git a/src/LaravelPareto.php b/src/LaravelPareto.php deleted file mode 100755 index 7ed5aba..0000000 --- a/src/LaravelPareto.php +++ /dev/null @@ -1,7 +0,0 @@ -app->runningInConsole()) { + $this->commands([ + TestCommand::class + ]); + } + } +}