diff --git a/.editorconfig b/.editorconfig index 1492202b..6537ca46 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,6 +11,5 @@ trim_trailing_whitespace = true [*.md] trim_trailing_whitespace = false -[*.yml] -indent_style = space +[*.{yml,yaml}] indent_size = 2 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 818f1217..5f7aa9e0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,7 +8,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - php: ['8.1', '8.2'] + php: ['8.1', '8.2', '8.3'] dependency-version: [lowest, highest] name: PHP ${{ matrix.php }} - ${{ matrix.os }} - ${{ matrix.dependency-version }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 1985bf38..4812c85b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,4 +45,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com) and this p ## [10.0.0 - 2023-02-16](https://github.com/laravel-zero/framework/releases/tag/v10.0.0) -Check the upgrade guide in the [Official Laravel Zero Upgrade Documentation](https://laravel-zero.com/docs/upgrade#upgrade-10.0.0). Also you can see some changes in the [Official Laravel Upgrade Documentation](https://laravel.com/docs/10.x/upgrade). +Check the upgrade guide in the [Official Laravel Zero Upgrade Documentation](https://laravel-zero.com/docs/upgrade#upgrade-10.0.0). Also, you can see some changes in the [Official Laravel Upgrade Documentation](https://laravel.com/docs/10.x/upgrade). diff --git a/README.md b/README.md index 05265559..0158b812 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,14 @@

- + Laravel Zero Logo

- Build Status - Total Downloads - Latest Stable Version - License + Build Status + Total Downloads + Latest Stable Version + License

-

This is a community project and not an official Laravel one

- Laravel Zero was created by [Nuno Maduro](https://github.com/nunomaduro) and [Owen Voke](https://github.com/owenvoke), and is a micro-framework that provides an elegant starting point for your console application. It is an **unofficial** and customized version of Laravel optimized for building command-line applications. > **Note:** This repository contains the core code of the Laravel Zero framework. If you want to build an application using Laravel Zero, visit the main [Laravel Zero repository](https://github.com/laravel-zero/laravel-zero). diff --git a/composer.json b/composer.json index c61a4749..569e682e 100755 --- a/composer.json +++ b/composer.json @@ -33,24 +33,24 @@ "illuminate/process": "^10.28", "illuminate/support": "^10.28", "illuminate/testing": "^10.28", - "laravel-zero/foundation": "^10.28", - "league/flysystem": "^3.15.1", - "nunomaduro/collision": "^6.4.0|^7.8.1", - "nunomaduro/laravel-console-summary": "^1.10.0", - "nunomaduro/laravel-console-task": "^1.8", - "nunomaduro/laravel-desktop-notifier": "^2.7", + "laravel-zero/foundation": "^10.48.8", + "league/flysystem": "^3.27.0", + "nunomaduro/collision": "^6.4.0|^7.10.0", + "nunomaduro/laravel-console-summary": "^1.11.1", + "nunomaduro/laravel-console-task": "^1.9", + "nunomaduro/laravel-desktop-notifier": "^2.8.1", "psr/log": "^1.1|^2.0|^3.0", - "ramsey/uuid": "^4.7.4", - "symfony/console": "^6.3.2", - "symfony/error-handler": "^6.3.2", - "symfony/event-dispatcher": "^6.3.2", - "symfony/finder": "^6.3.3", - "symfony/process": "^6.3.2", - "symfony/var-dumper": "^6.3.3", - "vlucas/phpdotenv": "^5.5" + "ramsey/uuid": "^4.7.5", + "symfony/console": "^6.4.6", + "symfony/error-handler": "^6.4.6", + "symfony/event-dispatcher": "^6.4.3", + "symfony/finder": "^6.4.0", + "symfony/process": "^6.4.4", + "symfony/var-dumper": "^6.4.6", + "vlucas/phpdotenv": "^5.6" }, "require-dev": { - "guzzlehttp/guzzle": "^7.7", + "guzzlehttp/guzzle": "^7.8.1", "illuminate/bus": "^10.28", "illuminate/database": "^10.28", "illuminate/http": "^10.28", @@ -58,15 +58,15 @@ "illuminate/queue": "^10.28", "illuminate/redis": "^10.28", "illuminate/view": "^10.28", - "laminas/laminas-text": "^2.10", + "laminas/laminas-text": "^2.11", "laravel-zero/phar-updater": "^1.4", - "laravel/pint": "^1.13.3", - "nunomaduro/laravel-console-dusk": "^1.11", - "nunomaduro/laravel-console-menu": "^3.4", + "laravel/pint": "^1.15.1", + "nunomaduro/laravel-console-dusk": "^1.12", + "nunomaduro/laravel-console-menu": "^3.5", "nunomaduro/termwind": "^1.15.1", - "pestphp/pest": "^2.22.1", - "pestphp/pest-plugin-laravel": "^2.2", - "phpstan/phpstan": "^1.10.38" + "pestphp/pest": "^2.34.7", + "pestphp/pest-plugin-laravel": "^2.3", + "phpstan/phpstan": "^1.10.67" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d5c86743..be00d3e0 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -6,16 +6,16 @@ > - ./tests + ./tests - ./src + ./src - ./src/Components/Database/stubs - ./src/Components/Log/stubs + ./src/Components/Database/stubs + ./src/Components/Log/stubs diff --git a/src/Application.php b/src/Application.php index 17c61ef0..d096a484 100644 --- a/src/Application.php +++ b/src/Application.php @@ -111,7 +111,7 @@ public function registerConfiguredProviders(): void } /** - * Throw an Console Exception with the given data unless the given condition is true. + * Throw a Console Exception with the given data unless the given condition is true. */ public function abort($code, $message = '', array $headers = []): void { diff --git a/src/Bootstrap/BuildLoadEnvironmentVariables.php b/src/Bootstrap/BuildLoadEnvironmentVariables.php index 8b7116c4..3a0c45e0 100644 --- a/src/Bootstrap/BuildLoadEnvironmentVariables.php +++ b/src/Bootstrap/BuildLoadEnvironmentVariables.php @@ -15,13 +15,13 @@ use Dotenv\Dotenv; use LaravelZero\Framework\Application; -use LaravelZero\Framework\Contracts\BoostrapperContract; +use LaravelZero\Framework\Contracts\BootstrapperContract; use LaravelZero\Framework\Providers\Build\Build; /** * @internal */ -final class BuildLoadEnvironmentVariables implements BoostrapperContract +final class BuildLoadEnvironmentVariables implements BootstrapperContract { /** * @var \LaravelZero\Framework\Providers\Build\Build @@ -42,7 +42,7 @@ public function __construct(Build $build) public function bootstrap(Application $app): void { /* - * Override environment variables with the environment file along side the Phar file. + * Override environment variables with the environment file alongside the Phar file. */ if ($this->build->shouldUseEnvironmentFile()) { Dotenv::createMutable($this->build->getDirectoryPath(), $this->build->environmentFile())->load(); diff --git a/src/Bootstrap/CoreBindings.php b/src/Bootstrap/CoreBindings.php index fda40922..9ed0fdf1 100644 --- a/src/Bootstrap/CoreBindings.php +++ b/src/Bootstrap/CoreBindings.php @@ -14,13 +14,13 @@ namespace LaravelZero\Framework\Bootstrap; use LaravelZero\Framework\Application; -use LaravelZero\Framework\Contracts\BoostrapperContract; +use LaravelZero\Framework\Contracts\BootstrapperContract; use LaravelZero\Framework\Providers\GitVersion\GitVersionServiceProvider; /** * @internal */ -final class CoreBindings implements BoostrapperContract +final class CoreBindings implements BootstrapperContract { /** * {@inheritdoc} diff --git a/src/Bootstrap/LoadConfiguration.php b/src/Bootstrap/LoadConfiguration.php index d69c455f..c34fe6a4 100644 --- a/src/Bootstrap/LoadConfiguration.php +++ b/src/Bootstrap/LoadConfiguration.php @@ -15,12 +15,12 @@ use Illuminate\Console\Application as Artisan; use LaravelZero\Framework\Application; -use LaravelZero\Framework\Contracts\BoostrapperContract; +use LaravelZero\Framework\Contracts\BootstrapperContract; /** * @internal */ -final class LoadConfiguration implements BoostrapperContract +final class LoadConfiguration implements BootstrapperContract { /** * {@inheritdoc} diff --git a/src/Bootstrap/LoadEnvironmentVariables.php b/src/Bootstrap/LoadEnvironmentVariables.php index 5fd29aab..089c5d9b 100644 --- a/src/Bootstrap/LoadEnvironmentVariables.php +++ b/src/Bootstrap/LoadEnvironmentVariables.php @@ -16,14 +16,14 @@ use Dotenv\Dotenv; use Illuminate\Foundation\Bootstrap\LoadEnvironmentVariables as BaseLoadEnvironmentVariables; use LaravelZero\Framework\Application; -use LaravelZero\Framework\Contracts\BoostrapperContract; +use LaravelZero\Framework\Contracts\BootstrapperContract; use function class_exists; /** * @internal */ -final class LoadEnvironmentVariables implements BoostrapperContract +final class LoadEnvironmentVariables implements BootstrapperContract { /** * {@inheritdoc} diff --git a/src/Bootstrap/RegisterFacades.php b/src/Bootstrap/RegisterFacades.php index 02f28707..5a30ef25 100644 --- a/src/Bootstrap/RegisterFacades.php +++ b/src/Bootstrap/RegisterFacades.php @@ -15,12 +15,12 @@ use Illuminate\Foundation\Bootstrap\RegisterFacades as BaseRegisterFacades; use LaravelZero\Framework\Application; -use LaravelZero\Framework\Contracts\BoostrapperContract; +use LaravelZero\Framework\Contracts\BootstrapperContract; /** * @internal */ -final class RegisterFacades implements BoostrapperContract +final class RegisterFacades implements BootstrapperContract { private $aliases = [ 'App' => \Illuminate\Support\Facades\App::class, diff --git a/src/Bootstrap/RegisterProviders.php b/src/Bootstrap/RegisterProviders.php index 88e940bb..9fb51159 100644 --- a/src/Bootstrap/RegisterProviders.php +++ b/src/Bootstrap/RegisterProviders.php @@ -16,7 +16,7 @@ use Illuminate\Foundation\Bootstrap\RegisterProviders as BaseRegisterProviders; use LaravelZero\Framework\Application; use LaravelZero\Framework\Components; -use LaravelZero\Framework\Contracts\BoostrapperContract; +use LaravelZero\Framework\Contracts\BootstrapperContract; use LaravelZero\Framework\Providers; use LaravelZero\Framework\Providers\Collision\CollisionServiceProvider; use LaravelZero\Framework\Providers\CommandRecorder\CommandRecorderServiceProvider; @@ -30,7 +30,7 @@ /** * @internal */ -final class RegisterProviders implements BoostrapperContract +final class RegisterProviders implements BootstrapperContract { /** * Core providers. diff --git a/src/Commands/BuildCommand.php b/src/Commands/BuildCommand.php index 7443367c..9a1c1151 100644 --- a/src/Commands/BuildCommand.php +++ b/src/Commands/BuildCommand.php @@ -15,6 +15,7 @@ use Illuminate\Console\Application as Artisan; use Illuminate\Support\Facades\File; +use RuntimeException; use Symfony\Component\Console\Command\SignalableCommandInterface; use Symfony\Component\Console\Helper\ProgressBar; use Symfony\Component\Console\Input\InputInterface; @@ -162,7 +163,13 @@ private function compile(string $name): BuildCommand $this->output->newLine(); - File::move($this->app->basePath($this->getBinary()).'.phar', $this->app->buildsPath($name)); + $pharPath = $this->app->basePath($this->getBinary()).'.phar'; + + if (! File::exists($pharPath)) { + throw new RuntimeException('Failed to compile the application.'); + } + + File::move($pharPath, $this->app->buildsPath($name)); return $this; } diff --git a/src/Commands/stubs/console.stub b/src/Commands/stubs/console.stub index 78602023..cc40e5af 100644 --- a/src/Commands/stubs/console.stub +++ b/src/Commands/stubs/console.stub @@ -1,6 +1,6 @@ exitCode = $exitCode; diff --git a/src/Providers/CommandRecorder/CommandRecorderRepository.php b/src/Providers/CommandRecorder/CommandRecorderRepository.php index f3f09cbf..194f5c01 100644 --- a/src/Providers/CommandRecorder/CommandRecorderRepository.php +++ b/src/Providers/CommandRecorder/CommandRecorderRepository.php @@ -29,7 +29,7 @@ final class CommandRecorderRepository /** * CommandRecorderRepository constructor. */ - public function __construct(Collection $storage = null) + public function __construct(?Collection $storage = null) { $this->storage = $storage ?? collect(); } diff --git a/src/Providers/Composer/Composer.php b/src/Providers/Composer/Composer.php index b641c958..8f224ccd 100644 --- a/src/Providers/Composer/Composer.php +++ b/src/Providers/Composer/Composer.php @@ -72,7 +72,7 @@ public function createProject(string $skeleton, string $projectName, array $opti /** * Runs the provided command on the provided folder. */ - private function run(string $cmd, string $cwd = null): bool + private function run(string $cmd, ?string $cwd = null): bool { $process = Process::fromShellCommandline($cmd, $cwd);