From 2d48fa2c27af28ad04670ab0864d543ac050f05c Mon Sep 17 00:00:00 2001 From: Arif Hoque Date: Sun, 30 Aug 2026 15:26:58 +0600 Subject: [PATCH] ready for doppar 4.x --- composer.json | 8 ++++---- src/Commands/MakeJobCommand.php | 2 +- src/{QueueServiceProvider.php => QueueLauncher.php} | 10 +++++----- tests/Unit/MakeJobCommandTest.php | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) rename src/{QueueServiceProvider.php => QueueLauncher.php} (81%) diff --git a/composer.json b/composer.json index 8fbc7d2..203aef4 100644 --- a/composer.json +++ b/composer.json @@ -15,8 +15,8 @@ ], "require-dev": { "mockery/mockery": "^1.6", - "phpunit/phpunit": "^12.1.5", - "doppar/framework": "3.*" + "phpunit/phpunit": "^13.3", + "doppar/framework": "4.*" }, "autoload": { "psr-4": { @@ -31,7 +31,7 @@ "extra": { "doppar": { "providers": [ - "Doppar\\Queue\\QueueServiceProvider" + "Doppar\\Queue\\QueueLauncher" ] } }, @@ -40,7 +40,7 @@ }, "minimum-stability": "dev", "require": { - "opis/closure": "^4.4" + "opis/closure": "^4.5" }, "prefer-stable": true } \ No newline at end of file diff --git a/src/Commands/MakeJobCommand.php b/src/Commands/MakeJobCommand.php index aa3c054..30bfe5b 100644 --- a/src/Commands/MakeJobCommand.php +++ b/src/Commands/MakeJobCommand.php @@ -37,7 +37,7 @@ public function handle(): int $namespace = 'App\\Jobs' . (count($parts) > 0 ? '\\' . implode('\\', $parts) : ''); $fileName = count($parts) > 0 ? implode('/', $parts) . '/' . $className : $className; - $filePath = $this->generatedFilePath('app/Jobs', $fileName); + $filePath = $this->generatedFilePath('src/Jobs', $fileName); // Check if Job already exists if (file_exists($filePath)) { diff --git a/src/QueueServiceProvider.php b/src/QueueLauncher.php similarity index 81% rename from src/QueueServiceProvider.php rename to src/QueueLauncher.php index adc79fe..aa5c182 100644 --- a/src/QueueServiceProvider.php +++ b/src/QueueLauncher.php @@ -3,8 +3,8 @@ namespace Doppar\Queue; use Doppar\Queue\Commands\MakeJobCommand; -use Phaseolies\Providers\GhostableProvider; -use Phaseolies\Providers\ServiceProvider; +use Phaseolies\Launchers\GhostableLauncher; +use Phaseolies\Launchers\ServiceLauncher; use Doppar\Queue\QueueManager; use Doppar\Queue\Commands\QueueRunCommand; use Doppar\Queue\Commands\QueueRetryCommand; @@ -12,7 +12,7 @@ use Doppar\Queue\Commands\QueueFailedCommand; use Doppar\Queue\Commands\QueueMonitorCommand; -class QueueServiceProvider extends ServiceProvider implements GhostableProvider +class QueueLauncher extends ServiceLauncher implements GhostableLauncher { /** * Register any application services. @@ -29,12 +29,12 @@ public function register(): void * * @return void */ - public function boot(): void + public function launch(): void { $this->loadMigrations(__DIR__ . '/database/migrations'); $this->publishes([ - __DIR__ . '/database/migrations' => database_path('migrations'), + __DIR__ . '/database/migrations' => schema_path('migrations'), ], 'migrations'); $this->commands([ diff --git a/tests/Unit/MakeJobCommandTest.php b/tests/Unit/MakeJobCommandTest.php index c55b2f1..7353157 100644 --- a/tests/Unit/MakeJobCommandTest.php +++ b/tests/Unit/MakeJobCommandTest.php @@ -86,7 +86,7 @@ protected function relativePath(string $path, ?string $basePath = null): string }; $result = $command->handle(); - $file = $this->tempRoot . '/app/Jobs/Reports/GenerateDailyJob.php'; + $file = $this->tempRoot . '/src/Jobs/Reports/GenerateDailyJob.php'; $contents = (string) file_get_contents($file); $this->assertSame(0, $result); @@ -95,7 +95,7 @@ protected function relativePath(string $path, ?string $basePath = null): string $this->assertStringContainsString('class GenerateDailyJob extends Job', $contents); $this->assertContains('Job created successfully', $command->capturedSuccesses); $this->assertContains( - '📦 File: app/Jobs/Reports/GenerateDailyJob.php', + '📦 File: src/Jobs/Reports/GenerateDailyJob.php', $command->capturedLines ); }