Skip to content

Commit

Permalink
Adds Laravel 11 support
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Apr 18, 2024
1 parent 1c44f0c commit 6af563e
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 111 deletions.
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
@@ -0,0 +1,4 @@
# These are supported funding model platforms

github: [nunomaduro]
custom: https://www.paypal.com/paypalme/enunomaduro
43 changes: 2 additions & 41 deletions CHANGELOG.md
Expand Up @@ -4,45 +4,6 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com) and this project adheres to [Semantic Versioning](https://semver.org).

## [10.3.0 - 2023-10-30](https://github.com/laravel-zero/framework/releases/tag/v10.3.0)
## [11.0.0 - 2024-04-18](https://github.com/laravel-zero/framework/releases/tag/v11.0.0)

### Changed
- Update Box to 4.5.x ([#487](https://github.com/laravel-zero/framework/pull/487))

### Fixed
- Resolve issue with Laravel Prompts on `app:build` command ([#486](https://github.com/laravel-zero/framework/pull/486))

## [10.2.0 - 2023-10-12](https://github.com/laravel-zero/framework/releases/tag/v10.2.0)

### Changed
- Update Box to 4.4.x ([#483](https://github.com/laravel-zero/framework/pull/483))
- Add Laravel Prompts ([#482](https://github.com/laravel-zero/framework/pull/482))

## [10.1.1 - 2023-07-14](https://github.com/laravel-zero/framework/releases/tag/v10.1.1)

### Fixed
- Reverts Box to 4.2.x ([803eb0e](https://github.com/laravel-zero/framework/commit/803eb0e9a53a5c0cf8fa128f9356de46d3375061))

## [10.1.0 - 2023-06-21](https://github.com/laravel-zero/framework/releases/tag/v10.1.0)

### Changed
- Update Symfony to 6.3.x ([#476](https://github.com/laravel-zero/framework/pull/476))
- Update Box to 4.3.x ([#475](https://github.com/laravel-zero/framework/pull/475))
- Update PHPUnit configuration

## [10.0.2 - 2023-03-21](https://github.com/laravel-zero/framework/releases/tag/v10.0.2)

### Added
- `nunomaduro/collision` v7 support

### Chore
- Bumps dependencies

## [10.0.1 - 2023-03-18](https://github.com/laravel-zero/framework/releases/tag/v10.0.1)

### Fixed
- Missing `symfony/event-dispatcher` dependency

## [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-11.0.0). Also, you can see some changes in the [Official Laravel Upgrade Documentation](https://laravel.com/docs/11.x/upgrade).
67 changes: 33 additions & 34 deletions composer.json
Expand Up @@ -19,53 +19,52 @@
}
],
"require": {
"php": "^8.1",
"php": "^8.2",
"ext-json": "*",
"dragonmantank/cron-expression": "^3.3.3",
"illuminate/cache": "^10.28",
"illuminate/collections": "^10.28",
"illuminate/config": "^10.28",
"illuminate/console": "^10.28",
"illuminate/container": "^10.28",
"illuminate/contracts": "^10.28",
"illuminate/events": "^10.28",
"illuminate/filesystem": "^10.28",
"illuminate/process": "^10.28",
"illuminate/support": "^10.28",
"illuminate/testing": "^10.28",
"laravel-zero/foundation": "^10.48.8",
"illuminate/cache": "^11.4.0",
"illuminate/collections": "^11.4.0",
"illuminate/config": "^11.4.0",
"illuminate/console": "^11.4.0",
"illuminate/container": "^11.4.0",
"illuminate/contracts": "^11.4.0",
"illuminate/events": "^11.4.0",
"illuminate/filesystem": "^11.4.0",
"illuminate/process": "^11.4.0",
"illuminate/support": "^11.4.0",
"illuminate/testing": "^11.4.0",
"laravel-zero/foundation": "dev-main",
"league/flysystem": "^3.27.0",
"nunomaduro/collision": "^6.4.0|^7.10.0",
"nunomaduro/collision": "^8.1.1",
"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",
"psr/log": "^3.0",
"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"
"symfony/console": "^7.0.6",
"symfony/error-handler": "^7.0.6",
"symfony/event-dispatcher": "^7.0.3",
"symfony/finder": "^7.0",
"symfony/process": "^7.0.4",
"symfony/var-dumper": "^7.0.6",
"vlucas/phpdotenv": "^5.6.0",
"guzzlehttp/guzzle": "^7.8.1",
"nunomaduro/termwind": "^2.0.1"
},
"require-dev": {
"guzzlehttp/guzzle": "^7.8.1",
"illuminate/bus": "^10.28",
"illuminate/database": "^10.28",
"illuminate/http": "^10.28",
"illuminate/log": "^10.28",
"illuminate/queue": "^10.28",
"illuminate/redis": "^10.28",
"illuminate/view": "^10.28",
"illuminate/bus": "^11.4.0",
"illuminate/database": "^11.4.0",
"illuminate/http": "^11.4.0",
"illuminate/log": "^11.4.0",
"illuminate/queue": "^11.4.0",
"illuminate/redis": "^11.4.0",
"illuminate/view": "^11.4.0",
"laminas/laminas-text": "^2.11",
"laravel-zero/phar-updater": "^1.4",
"laravel/pint": "^1.15.1",
"nunomaduro/laravel-console-dusk": "^1.12",
"nunomaduro/laravel-console-dusk": "^1.13",
"nunomaduro/laravel-console-menu": "^3.5",
"nunomaduro/termwind": "^1.15.1",
"pestphp/pest": "^2.34.7",
"pestphp/pest-plugin-laravel": "^2.3",
"phpstan/phpstan": "^1.10.67"
},
"autoload": {
Expand Down Expand Up @@ -103,7 +102,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "10.x-dev"
"dev-master": "11.x-dev"
}
},
"suggest": {
Expand Down
29 changes: 29 additions & 0 deletions src/Application.php
Expand Up @@ -16,6 +16,7 @@
use Illuminate\Events\EventServiceProvider;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Foundation\Application as BaseApplication;
use Illuminate\Foundation\Configuration\ApplicationBuilder;
use Illuminate\Foundation\PackageManifest;
use Illuminate\Support\Collection;
use Illuminate\Support\Str;
Expand All @@ -24,6 +25,34 @@

class Application extends BaseApplication
{
/**
* @{@inheritdoc}
*/
public static function configure(?string $basePath = null): ApplicationBuilder
{
$basePath = match (true) {
is_string($basePath) => $basePath,
default => static::inferBasePath(),
};

$builder = (new ApplicationBuilder(new static($basePath)));

Check failure on line 38 in src/Application.php

View workflow job for this annotation

GitHub Actions / PHPStan

Unsafe usage of new static().

$builder->create()->singleton(
\Illuminate\Contracts\Console\Kernel::class,
\LaravelZero\Framework\Kernel::class
);

$builder->create()->singleton(
\Illuminate\Contracts\Debug\ExceptionHandler::class,
\Illuminate\Foundation\Exceptions\Handler::class
);

return $builder
->withEvents()
->withCommands()
->withProviders();
}

/**
* Get the `builds` path. With, optionally, a path to append to the base path.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/BuildCommand.php
Expand Up @@ -82,7 +82,7 @@ public function getSubscribedSignals(): array
}

/** {@inheritdoc} */
public function handleSignal(int $signal): int|false
public function handleSignal(int $signal, int|false $previousExitCode = 0): int|false
{
if (defined('SIGINT') && $signal === \SIGINT) {
if (self::$config !== null) {
Expand Down
36 changes: 33 additions & 3 deletions src/Kernel.php
Expand Up @@ -52,6 +52,31 @@ class Kernel extends BaseKernel
TestCommand::class,
];

/**
* The application's default hidden commands.
*
* @var string[]
*/
protected $hiddenCommands = [
\NunoMaduro\LaravelConsoleSummary\SummaryCommand::class,
\Symfony\Component\Console\Command\DumpCompletionCommand::class,
\Symfony\Component\Console\Command\HelpCommand::class,
\Illuminate\Console\Scheduling\ScheduleRunCommand::class,
\Illuminate\Console\Scheduling\ScheduleListCommand::class,
\Illuminate\Console\Scheduling\ScheduleFinishCommand::class,
\Illuminate\Foundation\Console\VendorPublishCommand::class,
\LaravelZero\Framework\Commands\StubPublishCommand::class,

// ...
Commands\BuildCommand::class,
Commands\RenameCommand::class,
Commands\MakeCommand::class,
Commands\InstallCommand::class,
Commands\StubPublishCommand::class,
Commands\TestMakeCommand::class,
TestCommand::class,
];

/**
* The application's bootstrap classes.
*
Expand Down Expand Up @@ -160,7 +185,9 @@ protected function commands(): void
/**
* Loads configured commands.
*/
$commands = collect($config->get('commands.add', []))->merge($config->get('commands.hidden', []));
$commands = collect($config->get('commands.add', []))->merge(
$config->get('commands.hidden', $this->hiddenCommands),
);

if ($command = $config->get('commands.default')) {
$commands->push($command);
Expand Down Expand Up @@ -212,11 +239,14 @@ function ($artisan) use ($commands) {
}
);


Artisan::starting(
function ($artisan) use ($config) {
$commands = $config->get('commands.hidden', $this->hiddenCommands);

collect($artisan->all())->each(
function ($command) use ($config, $artisan) {
if (in_array(get_class($command), $config->get('commands.hidden', []), true)) {
function ($command) use ($config, $artisan, $commands) {

Check failure on line 248 in src/Kernel.php

View workflow job for this annotation

GitHub Actions / PHPStan

Anonymous function has an unused use $config.
if (in_array(get_class($command), $commands, true)) {
$command->setHidden(true);
}

Expand Down
5 changes: 0 additions & 5 deletions tests/Application/app/Providers/FakeServiceProvider.php
Expand Up @@ -4,11 +4,6 @@

use Illuminate\Support\ServiceProvider;

/**
* This is the Laravel Zero Framework fake service provider class.
*
* @author Nuno Maduro <enunomaduro@gmail.com>
*/
class FakeServiceProvider extends ServiceProvider
{
public function register()
Expand Down
22 changes: 0 additions & 22 deletions tests/Components/PestComponentTest.php

This file was deleted.

5 changes: 0 additions & 5 deletions tests/TestCase.php
Expand Up @@ -8,11 +8,6 @@
use LaravelZero\Framework\Application;
use LaravelZero\Framework\Testing\TestCase as BaseTestCase;

/**
* This is the Laravel Zero Framework test case class.
*
* @author Nuno Maduro <enunomaduro@gmail.com>
*/
abstract class TestCase extends BaseTestCase
{
/**
Expand Down

0 comments on commit 6af563e

Please sign in to comment.