diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 62854202..31b5f610 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - php: ['8.2', '8.3'] + php: ['8.2', '8.3', '8.4'] dependency-version: [lowest, highest] name: PHP ${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} @@ -38,4 +38,4 @@ jobs: composer-options: "--prefer-dist" - name: Run Tests - run: vendor/bin/pest + run: vendor/bin/pest --display-deprecation ${{ matrix.dependency-version == 'highest' && '--fail-on-deprecation' || '' }} diff --git a/composer.json b/composer.json index e51ba496..857c786b 100755 --- a/composer.json +++ b/composer.json @@ -21,51 +21,51 @@ "require": { "php": "^8.2", "ext-json": "*", - "dragonmantank/cron-expression": "^3.4.0", + "dragonmantank/cron-expression": "^3.4", "guzzlehttp/guzzle": "^7.9.2", - "illuminate/cache": "^11.30.0", - "illuminate/collections": "^11.30.0", - "illuminate/config": "^11.30.0", - "illuminate/console": "^11.30.0", - "illuminate/container": "^11.30.0", - "illuminate/contracts": "^11.30.0", - "illuminate/events": "^11.30.0", - "illuminate/filesystem": "^11.30.0", - "illuminate/process": "^11.30.0", - "illuminate/support": "^11.30.0", - "illuminate/testing": "^11.30.0", - "laravel-zero/foundation": "^11.5.0", + "illuminate/cache": "^12.17", + "illuminate/collections": "^12.17", + "illuminate/config": "^12.17", + "illuminate/console": "^12.17", + "illuminate/container": "^12.17", + "illuminate/contracts": "^12.17", + "illuminate/events": "^12.17", + "illuminate/filesystem": "^12.17", + "illuminate/process": "^12.17", + "illuminate/support": "^12.17", + "illuminate/testing": "^12.17", + "laravel-zero/foundation": "^12.17.1", "laravel/prompts": "^0.3.1", "league/flysystem": "^3.29.1", - "nunomaduro/collision": "^8.5.0", + "nunomaduro/collision": "^8.8", "nunomaduro/laravel-console-summary": "^1.12.1", "nunomaduro/laravel-console-task": "^1.9", "nunomaduro/laravel-desktop-notifier": "^2.8.1", "nunomaduro/termwind": "^2.2.0", "psr/log": "^3.0.2", "ramsey/uuid": "^4.7.6", - "symfony/console": "^7.1.6", - "symfony/error-handler": "^7.1.6", - "symfony/event-dispatcher": "^7.1.6", - "symfony/finder": "^7.1.6", - "symfony/process": "^7.1.6", - "symfony/var-dumper": "^7.1.6", + "symfony/console": "^7.2", + "symfony/error-handler": "^7.2", + "symfony/event-dispatcher": "^7.2", + "symfony/finder": "^7.2", + "symfony/process": "^7.2", + "symfony/var-dumper": "^7.2", "vlucas/phpdotenv": "^5.6.1" }, "require-dev": { - "illuminate/bus": "^11.30.0", - "illuminate/database": "^11.30.0", - "illuminate/http": "^11.30.0", - "illuminate/log": "^11.30.0", - "illuminate/queue": "^11.30.0", - "illuminate/redis": "^11.30.0", - "illuminate/view": "^11.30.0", - "laravel-zero/phar-updater": "^1.4", - "laravel/pint": "^1.18.1", - "nunomaduro/laravel-console-dusk": "^1.13.1", - "nunomaduro/laravel-console-menu": "^3.5", - "pestphp/pest": "^3.5.1", - "phpstan/phpstan": "^1.12.7" + "illuminate/bus": "^12.17", + "illuminate/database": "^12.17", + "illuminate/http": "^12.17", + "illuminate/log": "^12.17", + "illuminate/queue": "^12.17", + "illuminate/redis": "^12.17", + "illuminate/view": "^12.17", + "laravel-zero/phar-updater": "^1.4.1", + "laravel/pint": "^1.21", + "nunomaduro/laravel-console-dusk": "^1.14", + "nunomaduro/laravel-console-menu": "^3.6", + "pestphp/pest": "^3.8", + "phpstan/phpstan": "^2.1" }, "autoload": { "psr-4": { @@ -102,7 +102,7 @@ }, "extra": { "branch-alias": { - "dev-master": "11.x-dev" + "dev-master": "12.x-dev" } }, "suggest": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index be00d3e0..d67a63e3 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -3,6 +3,8 @@ xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true" + stopOnError="false" + stopOnFailure="false" > diff --git a/src/Application.php b/src/Application.php index dc78a768..5e789219 100644 --- a/src/Application.php +++ b/src/Application.php @@ -127,6 +127,7 @@ public function registerConfiguredProviders(): void $providers->splice( 1, 0, + // @phpstan-ignore argument.type [ $this->make(PackageManifest::class) ->providers(), diff --git a/src/Commands/BuildCommand.php b/src/Commands/BuildCommand.php index 6ddffd11..f31ae1b1 100644 --- a/src/Commands/BuildCommand.php +++ b/src/Commands/BuildCommand.php @@ -82,7 +82,7 @@ public function getSubscribedSignals(): array } /** {@inheritdoc} */ - public function handleSignal(int $signal, int|false $previousExitCode = 0): int|false + public function handleSignal(int $signal, int|false $previousExitCode = 0): int { if (defined('SIGINT') && $signal === \SIGINT) { if (self::$config !== null) { diff --git a/src/Commands/Command.php b/src/Commands/Command.php index 56d71e46..1e05b738 100644 --- a/src/Commands/Command.php +++ b/src/Commands/Command.php @@ -31,6 +31,9 @@ abstract class Command extends BaseCommand */ protected $app; + /** {@inheritdoc} */ + protected $description = ''; + /** * Define the command's schedule. */ diff --git a/src/Commands/InstallCommand.php b/src/Commands/InstallCommand.php index 16b33128..c1ce718c 100644 --- a/src/Commands/InstallCommand.php +++ b/src/Commands/InstallCommand.php @@ -60,6 +60,7 @@ public function handle() $option = $this->choice($title, $choices); } + // @phpstan-ignore notIdentical.alwaysTrue if ($option !== null && ! empty($this->componentInstallers[$option])) { /** @var AbstractInstaller $command */ $command = $this->app[$this->componentInstallers[$option]]; diff --git a/src/Components/Database/Installer.php b/src/Components/Database/Installer.php index 10a26033..d5b0a2e5 100644 --- a/src/Components/Database/Installer.php +++ b/src/Components/Database/Installer.php @@ -47,7 +47,7 @@ final class Installer extends AbstractInstaller */ public function install(): void { - $this->require('illuminate/database "^11.5"'); + $this->require('illuminate/database "^12.17"'); $this->require('fakerphp/faker "^1.23"', true); $this->task( diff --git a/src/Components/Http/Installer.php b/src/Components/Http/Installer.php index 9ba7e29f..2a66aac5 100644 --- a/src/Components/Http/Installer.php +++ b/src/Components/Http/Installer.php @@ -35,6 +35,6 @@ final class Installer extends AbstractInstaller */ public function install(): void { - $this->require('illuminate/http "^11.5"'); + $this->require('illuminate/http "^12.17"'); } } diff --git a/src/Components/Log/Installer.php b/src/Components/Log/Installer.php index ec2af506..f720af1f 100644 --- a/src/Components/Log/Installer.php +++ b/src/Components/Log/Installer.php @@ -41,7 +41,7 @@ final class Installer extends AbstractInstaller */ public function install(): void { - $this->require('illuminate/log "^11.5"'); + $this->require('illuminate/log "^12.17"'); $this->task( 'Creating default logging configuration', diff --git a/src/Components/Queue/Installer.php b/src/Components/Queue/Installer.php index 994e6bcf..8d7f7f3a 100644 --- a/src/Components/Queue/Installer.php +++ b/src/Components/Queue/Installer.php @@ -43,8 +43,8 @@ public function install(): void { $this->call('app:install', ['component' => 'database']); - $this->require('illuminate/bus "^11.5"'); - $this->require('illuminate/queue "^11.5"'); + $this->require('illuminate/bus "^12.17"'); + $this->require('illuminate/queue "^12.17"'); $this->task( 'Creating default queue configuration', diff --git a/src/Components/Redis/Installer.php b/src/Components/Redis/Installer.php index d0992a2a..81f149b8 100644 --- a/src/Components/Redis/Installer.php +++ b/src/Components/Redis/Installer.php @@ -27,6 +27,6 @@ final class Installer extends AbstractInstaller /** {@inheritdoc} */ public function install(): void { - $this->require('illuminate/redis "^11.5"'); + $this->require('illuminate/redis "^12.17"'); } } diff --git a/src/Components/View/Installer.php b/src/Components/View/Installer.php index 5c01a11b..54f64a88 100644 --- a/src/Components/View/Installer.php +++ b/src/Components/View/Installer.php @@ -41,7 +41,7 @@ final class Installer extends AbstractInstaller */ public function install(): void { - $this->require('illuminate/view "^11.5"'); + $this->require('illuminate/view "^12.17"'); $this->task( 'Creating resources/views folder', diff --git a/src/Providers/Filesystem/FilesystemServiceProvider.php b/src/Providers/Filesystem/FilesystemServiceProvider.php index ddb8ba72..5e489f13 100644 --- a/src/Providers/Filesystem/FilesystemServiceProvider.php +++ b/src/Providers/Filesystem/FilesystemServiceProvider.php @@ -54,4 +54,10 @@ protected function getDefaultConfig(): array ], ]; } + + /** Laravel Zero doesn't support serving files. */ + protected function shouldServeFiles(array $config) + { + return false; + } } diff --git a/tests/Application/bootstrap/app.php b/tests/Application/bootstrap/app.php index 1aa25091..c0f685b6 100755 --- a/tests/Application/bootstrap/app.php +++ b/tests/Application/bootstrap/app.php @@ -1,17 +1,5 @@ singleton( - Illuminate\Contracts\Console\Kernel::class, - LaravelZero\Framework\Kernel::class -); - -$app->singleton( - Illuminate\Contracts\Debug\ExceptionHandler::class, - Illuminate\Foundation\Exceptions\Handler::class -); - -return $app; +return Application::configure(basePath: dirname(__DIR__))->create(); diff --git a/tests/Components/LogInstallTest.php b/tests/Components/LogInstallTest.php index f9d8f33e..747c8795 100755 --- a/tests/Components/LogInstallTest.php +++ b/tests/Components/LogInstallTest.php @@ -15,7 +15,7 @@ $composerMock->expects($this->once()) ->method('require') - ->with('illuminate/log "^11.5"'); + ->with('illuminate/log "^12.17"'); $this->app->instance(ComposerContract::class, $composerMock); diff --git a/tests/Components/RedisInstallTest.php b/tests/Components/RedisInstallTest.php index 73682e07..db022bcb 100755 --- a/tests/Components/RedisInstallTest.php +++ b/tests/Components/RedisInstallTest.php @@ -10,7 +10,7 @@ $composerMock->expects($this->once()) ->method('require') - ->with('illuminate/redis "^11.5"', false); + ->with('illuminate/redis "^12.17"', false); $this->app->instance(ComposerContract::class, $composerMock); diff --git a/tests/TestCase.php b/tests/TestCase.php index 852263cb..8b6d3e9b 100755 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -4,8 +4,8 @@ namespace Tests; +use Illuminate\Contracts\Console\Kernel; use Illuminate\Contracts\Foundation\Application as ApplicationContract; -use LaravelZero\Framework\Application; use LaravelZero\Framework\Testing\TestCase as BaseTestCase; abstract class TestCase extends BaseTestCase @@ -13,13 +13,11 @@ abstract class TestCase extends BaseTestCase /** * The application instance. * - * @var \Illuminate\Contracts\Foundation\Application + * @var ApplicationContract */ protected $app; - /** - * {@inheritdoc} - */ + /** {@inheritdoc} */ protected function setUp(): void { if (! defined('ARTISAN_BINARY')) { @@ -27,20 +25,13 @@ protected function setUp(): void } parent::setUp(); - - $this->app = $this->createApplication(); } - /** - * Creates a new instance of the application. - */ public function createApplication(): ApplicationContract { $app = require __DIR__.'/Application/bootstrap/app.php'; - Application::setInstance($app); - - $app->make(\Illuminate\Contracts\Console\Kernel::class)->bootstrap(); + $app->make(Kernel::class)->bootstrap(); return $app; }