diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7b175f145fa2..25d3a62e4e51 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -73,7 +73,7 @@ jobs: with: timeout_minutes: 5 max_attempts: 5 - command: composer require ramsey/collection:^1.2 brick/math:^0.9.3 --no-interaction --no-update + command: composer require ramsey/collection:^1.2 brick/math:^0.9.3 symfony/css-selector:^6.0 --no-interaction --no-update if: matrix.php >= 8.1 - name: Set Minimum PHP 8.2 Versions @@ -145,12 +145,20 @@ jobs: command: composer require guzzlehttp/guzzle:~7.2 --no-interaction --no-update if: matrix.php >= 8 + - name: Set Minimum PHP 8.1 Versions + uses: nick-fields/retry@v2 + with: + timeout_minutes: 5 + max_attempts: 5 + command: composer require ramsey/collection:~1.2 brick/math:~0.9.3 symfony/css-selector:~6.0 --no-interaction --no-update + if: matrix.php >= 8.1 + - name: Set Minimum PHP 8.2 Versions uses: nick-fields/retry@v2 with: timeout_minutes: 5 max_attempts: 5 - command: composer require guzzlehttp/guzzle:~7.5 guzzlehttp/psr7:~2.4 predis/predis:^2.0.2 --no-interaction --no-update + command: composer require guzzlehttp/guzzle:~7.5 guzzlehttp/psr7:~2.4 predis/predis:~2.0.2 --no-interaction --no-update if: matrix.php >= 8.2 - name: Install dependencies diff --git a/composer.json b/composer.json index 97280b8aa19f..dd775c9576de 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "egulias/email-validator": "^3.2.1", "fruitcake/php-cors": "^1.2", "laravel/serializable-closure": "^1.2.2", - "league/commonmark": "^2.2", + "league/commonmark": "^2.2.1", "league/flysystem": "^3.8.0", "monolog/monolog": "^2.0", "nesbot/carbon": "^2.62.1", @@ -85,7 +85,7 @@ "ably/ably-php": "^1.0", "aws/aws-sdk-php": "^3.235.5", "doctrine/dbal": "^2.13.3|^3.1.4", - "fakerphp/faker": "^1.9.2", + "fakerphp/faker": "^1.21", "guzzlehttp/guzzle": "^7.5", "league/flysystem-aws-s3-v3": "^3.0", "league/flysystem-ftp": "^3.0", @@ -93,7 +93,7 @@ "league/flysystem-read-only": "^3.3", "league/flysystem-sftp-v3": "^3.0", "mockery/mockery": "^1.5.1", - "orchestra/testbench-core": "^7.11", + "orchestra/testbench-core": "^7.16", "pda/pheanstalk": "^4.0", "phpstan/phpstan": "^1.4.7", "phpunit/phpunit": "^9.5.8", diff --git a/src/Illuminate/Console/Command.php b/src/Illuminate/Console/Command.php index 675622059d6a..8b4001cb8f52 100755 --- a/src/Illuminate/Console/Command.php +++ b/src/Illuminate/Console/Command.php @@ -42,7 +42,7 @@ class Command extends SymfonyCommand /** * The console command description. * - * @var string + * @var string|null */ protected $description; diff --git a/src/Illuminate/Console/Scheduling/CallbackEvent.php b/src/Illuminate/Console/Scheduling/CallbackEvent.php index e91600ac3a40..db5e0297072a 100644 --- a/src/Illuminate/Console/Scheduling/CallbackEvent.php +++ b/src/Illuminate/Console/Scheduling/CallbackEvent.php @@ -184,7 +184,7 @@ public function getSummaryForDisplay() */ public function mutexName() { - return 'framework/schedule-'.sha1($this->description); + return 'framework/schedule-'.sha1($this->description ?? ''); } /** diff --git a/src/Illuminate/Console/Scheduling/Event.php b/src/Illuminate/Console/Scheduling/Event.php index a132ad3c63da..36c180b95a30 100644 --- a/src/Illuminate/Console/Scheduling/Event.php +++ b/src/Illuminate/Console/Scheduling/Event.php @@ -26,7 +26,7 @@ class Event /** * The command string. * - * @var string + * @var string|null */ public $command; @@ -47,7 +47,7 @@ class Event /** * The user the command should run as. * - * @var string + * @var string|null */ public $user; @@ -138,7 +138,7 @@ class Event /** * The human readable description of the event. * - * @var string + * @var string|null */ public $description; diff --git a/src/Illuminate/Console/Scheduling/ScheduleListCommand.php b/src/Illuminate/Console/Scheduling/ScheduleListCommand.php index 615bb4c6497c..9f26f09cef39 100644 --- a/src/Illuminate/Console/Scheduling/ScheduleListCommand.php +++ b/src/Illuminate/Console/Scheduling/ScheduleListCommand.php @@ -80,19 +80,20 @@ public function handle(Schedule $schedule) $events = $events->map(function ($event) use ($terminalWidth, $expressionSpacing, $timezone) { $expression = $this->formatCronExpression($event->expression, $expressionSpacing); - $command = $event->command; - $description = $event->description; + $command = $event->command ?? ''; + + $description = $event->description ?? ''; if (! $this->output->isVerbose()) { $command = str_replace([Application::phpBinary(), Application::artisanBinary()], [ 'php', preg_replace("#['\"]#", '', Application::artisanBinary()), - ], $event->command); + ], $command); } if ($event instanceof CallbackEvent) { - if (class_exists($event->description)) { - $command = $event->description; + if (class_exists($description)) { + $command = $description; $description = ''; } else { $command = 'Closure at: '.$this->getClosureLocation($event); @@ -149,7 +150,7 @@ private function getCronExpressionSpacing($events) { $rows = $events->map(fn ($event) => array_map('mb_strlen', preg_split("/\s+/", $event->expression))); - return collect($rows[0] ?? [])->keys()->map(fn ($key) => $rows->max($key)); + return collect($rows[0] ?? [])->keys()->map(fn ($key) => $rows->max($key))->all(); } /** diff --git a/src/Illuminate/Database/Eloquent/BroadcastableModelEventOccurred.php b/src/Illuminate/Database/Eloquent/BroadcastableModelEventOccurred.php index 14be425afa43..249b18301d8a 100644 --- a/src/Illuminate/Database/Eloquent/BroadcastableModelEventOccurred.php +++ b/src/Illuminate/Database/Eloquent/BroadcastableModelEventOccurred.php @@ -46,6 +46,13 @@ class BroadcastableModelEventOccurred implements ShouldBroadcast */ public $queue; + /** + * Indicates whether the job should be dispatched after all database transactions have committed. + * + * @var bool|null + */ + public $afterCommit; + /** * Create a new event instance. * diff --git a/src/Illuminate/Database/composer.json b/src/Illuminate/Database/composer.json index 912ac9f484c4..4a94f707dddc 100644 --- a/src/Illuminate/Database/composer.json +++ b/src/Illuminate/Database/composer.json @@ -36,7 +36,7 @@ }, "suggest": { "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.4).", - "fakerphp/faker": "Required to use the eloquent factory builder (^1.9.1).", + "fakerphp/faker": "Required to use the eloquent factory builder (^1.21).", "illuminate/console": "Required to use the database commands (^9.0).", "illuminate/events": "Required to use the observers with Eloquent (^9.0).", "illuminate/filesystem": "Required to use the migrations (^9.0).", diff --git a/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php b/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php index 712576576cfc..a67649b931f8 100644 --- a/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php +++ b/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php @@ -68,10 +68,8 @@ public function bootstrap(Application $app) public function handleError($level, $message, $file = '', $line = 0, $context = []) { if ($this->isDeprecation($level)) { - return $this->handleDeprecationError($message, $file, $line, $level); - } - - if (error_reporting() & $level) { + $this->handleDeprecationError($message, $file, $line, $level); + } elseif (error_reporting() & $level) { throw new ErrorException($message, 0, $level, $file, $line); } } diff --git a/src/Illuminate/Http/Resources/Json/AnonymousResourceCollection.php b/src/Illuminate/Http/Resources/Json/AnonymousResourceCollection.php index a583136490a6..26f5c460ce63 100644 --- a/src/Illuminate/Http/Resources/Json/AnonymousResourceCollection.php +++ b/src/Illuminate/Http/Resources/Json/AnonymousResourceCollection.php @@ -11,6 +11,13 @@ class AnonymousResourceCollection extends ResourceCollection */ public $collects; + /** + * Indicates if the collection keys should be preserved. + * + * @var bool + */ + public $preserveKeys = false; + /** * Create a new anonymous resource collection. * diff --git a/tests/Integration/Auth/ForgotPasswordTest.php b/tests/Integration/Auth/ForgotPasswordTest.php index 8d7298e90c77..94766105ae78 100644 --- a/tests/Integration/Auth/ForgotPasswordTest.php +++ b/tests/Integration/Auth/ForgotPasswordTest.php @@ -6,6 +6,7 @@ use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Support\Facades\Notification; use Illuminate\Support\Facades\Password; +use Illuminate\Support\Str; use Illuminate\Tests\Integration\Auth\Fixtures\AuthenticationTestUser; use Orchestra\Testbench\Factories\UserFactory; use Orchestra\Testbench\TestCase; @@ -22,6 +23,7 @@ protected function tearDown(): void protected function defineEnvironment($app) { + $app['config']->set('app.key', Str::random(32)); $app['config']->set('auth.providers.users.model', AuthenticationTestUser::class); } diff --git a/tests/Integration/Auth/ForgotPasswordWithoutDefaultRoutesTest.php b/tests/Integration/Auth/ForgotPasswordWithoutDefaultRoutesTest.php index 787483f027d6..221601ac76f6 100644 --- a/tests/Integration/Auth/ForgotPasswordWithoutDefaultRoutesTest.php +++ b/tests/Integration/Auth/ForgotPasswordWithoutDefaultRoutesTest.php @@ -6,6 +6,7 @@ use Illuminate\Notifications\Messages\MailMessage; use Illuminate\Support\Facades\Notification; use Illuminate\Support\Facades\Password; +use Illuminate\Support\Str; use Illuminate\Tests\Integration\Auth\Fixtures\AuthenticationTestUser; use Orchestra\Testbench\Factories\UserFactory; use Orchestra\Testbench\TestCase; @@ -22,6 +23,7 @@ protected function tearDown(): void protected function defineEnvironment($app) { + $app['config']->set('app.key', Str::random(32)); $app['config']->set('auth.providers.users.model', AuthenticationTestUser::class); } diff --git a/tests/Integration/Console/Events/EventListCommandTest.php b/tests/Integration/Console/Events/EventListCommandTest.php index 3273c7da33c1..200f8df3c80b 100644 --- a/tests/Integration/Console/Events/EventListCommandTest.php +++ b/tests/Integration/Console/Events/EventListCommandTest.php @@ -10,6 +10,8 @@ class EventListCommandTest extends TestCase { + public $dispatcher; + protected function setUp(): void { parent::setUp(); diff --git a/tests/Integration/Console/Scheduling/ScheduleListCommandTest.php b/tests/Integration/Console/Scheduling/ScheduleListCommandTest.php index 2b32a7d5585e..4c0d6bcee70f 100644 --- a/tests/Integration/Console/Scheduling/ScheduleListCommandTest.php +++ b/tests/Integration/Console/Scheduling/ScheduleListCommandTest.php @@ -11,6 +11,8 @@ class ScheduleListCommandTest extends TestCase { + public $schedule; + protected function setUp(): void { parent::setUp(); diff --git a/tests/Integration/Console/Scheduling/ScheduleTestCommandTest.php b/tests/Integration/Console/Scheduling/ScheduleTestCommandTest.php index 66e81e74883d..cde9883d8242 100644 --- a/tests/Integration/Console/Scheduling/ScheduleTestCommandTest.php +++ b/tests/Integration/Console/Scheduling/ScheduleTestCommandTest.php @@ -11,6 +11,8 @@ class ScheduleTestCommandTest extends TestCase { + public $schedule; + protected function setUp(): void { parent::setUp(); diff --git a/tests/Integration/Database/DatabaseEloquentModelCustomCastingTest.php b/tests/Integration/Database/DatabaseEloquentModelCustomCastingTest.php index 2cea72d6cd82..9d7ad20ec53a 100644 --- a/tests/Integration/Database/DatabaseEloquentModelCustomCastingTest.php +++ b/tests/Integration/Database/DatabaseEloquentModelCustomCastingTest.php @@ -304,6 +304,8 @@ class TestEloquentModelWithCustomCast extends Model class HashCaster implements CastsInboundAttributes { + protected $algorithm; + public function __construct($algorithm = 'sha256') { $this->algorithm = $algorithm; diff --git a/tests/Integration/Database/EloquentHasOneOfManyTest.php b/tests/Integration/Database/EloquentHasOneOfManyTest.php index fc1edfbf8b75..2f0b774ce401 100644 --- a/tests/Integration/Database/EloquentHasOneOfManyTest.php +++ b/tests/Integration/Database/EloquentHasOneOfManyTest.php @@ -8,6 +8,8 @@ class EloquentHasOneOfManyTest extends DatabaseTestCase { + public $retrievedLogins; + protected function defineDatabaseMigrationsAfterDatabaseRefreshed() { Schema::create('users', function ($table) { diff --git a/tests/Integration/Migration/MigratorTest.php b/tests/Integration/Migration/MigratorTest.php index 5e364b113c72..28ae835e8a95 100644 --- a/tests/Integration/Migration/MigratorTest.php +++ b/tests/Integration/Migration/MigratorTest.php @@ -14,6 +14,8 @@ class MigratorTest extends TestCase */ private $output; + public $subject; + protected function setUp(): void { parent::setUp(); diff --git a/tests/Integration/Notifications/SendingMailNotificationsTest.php b/tests/Integration/Notifications/SendingMailNotificationsTest.php index 5fe74775f2ef..8a70ef63b3e2 100644 --- a/tests/Integration/Notifications/SendingMailNotificationsTest.php +++ b/tests/Integration/Notifications/SendingMailNotificationsTest.php @@ -21,6 +21,7 @@ class SendingMailNotificationsTest extends TestCase { + public $mailFactory; public $mailer; public $markdown; diff --git a/tests/Integration/Queue/ThrottlesExceptionsWithRedisTest.php b/tests/Integration/Queue/ThrottlesExceptionsWithRedisTest.php index 014b7e16f276..87a7af68a22c 100644 --- a/tests/Integration/Queue/ThrottlesExceptionsWithRedisTest.php +++ b/tests/Integration/Queue/ThrottlesExceptionsWithRedisTest.php @@ -129,6 +129,8 @@ class CircuitBreakerWithRedisTestJob public static $handled = false; + public $key; + public function __construct($key) { $this->key = $key; @@ -153,6 +155,8 @@ class CircuitBreakerWithRedisSuccessfulJob public static $handled = false; + public $key; + public function __construct($key) { $this->key = $key; diff --git a/tests/Integration/Routing/UrlSigningTest.php b/tests/Integration/Routing/UrlSigningTest.php index 7c9c69deff84..a19eb44b802a 100644 --- a/tests/Integration/Routing/UrlSigningTest.php +++ b/tests/Integration/Routing/UrlSigningTest.php @@ -286,6 +286,7 @@ public function __construct(array $ignore) class RoutableInterfaceStub implements UrlRoutable { public $key; + public $routable; public $slug = 'routable-slug'; public function getRouteKey()