Skip to content

Commit bd8aeb6

Browse files
committedFeb 24, 2025
fix conflicts
2 parents 2d0d986 + 9de7525 commit bd8aeb6

File tree

14 files changed

+126
-40
lines changed

14 files changed

+126
-40
lines changed
 

‎CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Release Notes for 12.x
22

3-
## [Unreleased](https://github.com/laravel/framework/compare/v12.0.0..master)
3+
## [Unreleased](https://github.com/laravel/framework/compare/v11.44.0..v12.0.0)

‎src/Illuminate/Concurrency/Console/InvokeSerializedClosureCommand.php

+16
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Illuminate\Concurrency\Console;
44

55
use Illuminate\Console\Command;
6+
use ReflectionClass;
67
use Symfony\Component\Console\Attribute\AsCommand;
78
use Throwable;
89

@@ -51,12 +52,27 @@ public function handle()
5152
} catch (Throwable $e) {
5253
report($e);
5354

55+
$reflection = new ReflectionClass($e);
56+
$constructor = $reflection->getConstructor();
57+
$parameters = [];
58+
59+
if ($constructor) {
60+
$declaringClass = $constructor->getDeclaringClass()->getName();
61+
62+
if ($declaringClass === $reflection->getName()) {
63+
foreach ($constructor->getParameters() as $parameter) {
64+
$parameters[$parameter->name] = $e->{$parameter->name} ?? null;
65+
}
66+
}
67+
}
68+
5469
$this->output->write(json_encode([
5570
'successful' => false,
5671
'exception' => get_class($e),
5772
'message' => $e->getMessage(),
5873
'file' => $e->getFile(),
5974
'line' => $e->getLine(),
75+
'parameters' => $parameters,
6076
]));
6177
}
6278
}

‎src/Illuminate/Concurrency/ProcessDriver.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ public function run(Closure|array $tasks): array
4848

4949
if (! $result['successful']) {
5050
throw new $result['exception'](
51-
$result['message']
51+
...(! empty(array_filter($result['parameters']))
52+
? $result['parameters']
53+
: [$result['message']])
5254
);
5355
}
5456

‎src/Illuminate/Database/Eloquent/Factories/Factory.php

+9-1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,13 @@ abstract class Factory
113113
*/
114114
public static $namespace = 'Database\\Factories\\';
115115

116+
/**
117+
* @deprecated use $modelNameResolvers
118+
*
119+
* @var callable(self): class-string<TModel>
120+
*/
121+
protected static $modelNameResolver;
122+
116123
/**
117124
* The default model name resolvers.
118125
*
@@ -810,7 +817,7 @@ public function modelName()
810817
return $this->model;
811818
}
812819

813-
$resolver = static::$modelNameResolvers[static::class] ?? static::$modelNameResolvers[self::class] ?? function (self $factory) {
820+
$resolver = static::$modelNameResolvers[static::class] ?? static::$modelNameResolvers[self::class] ?? static::$modelNameResolver ?? function (self $factory) {
814821
$namespacedFactoryBasename = Str::replaceLast(
815822
'Factory', '', Str::replaceFirst(static::$namespace, '', $factory::class)
816823
);
@@ -931,6 +938,7 @@ protected static function appNamespace()
931938
*/
932939
public static function flushState()
933940
{
941+
static::$modelNameResolver = null;
934942
static::$modelNameResolvers = [];
935943
static::$factoryNameResolver = null;
936944
static::$namespace = 'Database\\Factories\\';

‎src/Illuminate/Foundation/Application.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Application extends Container implements ApplicationContract, CachesConfig
4545
*
4646
* @var string
4747
*/
48-
const VERSION = '12.x-dev';
48+
const VERSION = '12.0.0';
4949

5050
/**
5151
* The base path for the Laravel installation.

‎src/Illuminate/Foundation/Console/ServeCommand.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ class ServeCommand extends Command
9696
#[\Override]
9797
protected function initialize(InputInterface $input, OutputInterface $output)
9898
{
99-
$this->phpServerWorkers = transform(env('PHP_CLI_SERVER_WORKERS', 1), function ($workers) {
100-
if (! is_int($workers) || $workers < 2) {
99+
$this->phpServerWorkers = transform((int) env('PHP_CLI_SERVER_WORKERS', 1), function (int $workers) {
100+
if ($workers < 2) {
101101
return false;
102102
}
103103

‎src/Illuminate/Foundation/Testing/Concerns/InteractsWithDatabase.php

+18-18
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ trait InteractsWithDatabase
1919
/**
2020
* Assert that a given where condition exists in the database.
2121
*
22-
* @param \Illuminate\Database\Eloquent\Model|string $table
23-
* @param array $data
22+
* @param \Illuminate\Database\Eloquent\Model|class-string<\Illuminate\Database\Eloquent\Model>|string $table
23+
* @param array<string, mixed> $data
2424
* @param string|null $connection
2525
* @return $this
2626
*/
@@ -43,8 +43,8 @@ protected function assertDatabaseHas($table, array $data = [], $connection = nul
4343
/**
4444
* Assert that a given where condition does not exist in the database.
4545
*
46-
* @param \Illuminate\Database\Eloquent\Model|string $table
47-
* @param array $data
46+
* @param \Illuminate\Database\Eloquent\Model|class-string<\Illuminate\Database\Eloquent\Model>|string $table
47+
* @param array<string, mixed> $data
4848
* @param string|null $connection
4949
* @return $this
5050
*/
@@ -69,7 +69,7 @@ protected function assertDatabaseMissing($table, array $data = [], $connection =
6969
/**
7070
* Assert the count of table entries.
7171
*
72-
* @param \Illuminate\Database\Eloquent\Model|string $table
72+
* @param \Illuminate\Database\Eloquent\Model|class-string<\Illuminate\Database\Eloquent\Model>|string $table
7373
* @param int $count
7474
* @param string|null $connection
7575
* @return $this
@@ -86,7 +86,7 @@ protected function assertDatabaseCount($table, int $count, $connection = null)
8686
/**
8787
* Assert that the given table has no entries.
8888
*
89-
* @param \Illuminate\Database\Eloquent\Model|string $table
89+
* @param \Illuminate\Database\Eloquent\Model|class-string<\Illuminate\Database\Eloquent\Model>|string $table
9090
* @param string|null $connection
9191
* @return $this
9292
*/
@@ -102,8 +102,8 @@ protected function assertDatabaseEmpty($table, $connection = null)
102102
/**
103103
* Assert the given record has been "soft deleted".
104104
*
105-
* @param \Illuminate\Database\Eloquent\Model|string $table
106-
* @param array $data
105+
* @param \Illuminate\Database\Eloquent\Model|class-string<\Illuminate\Database\Eloquent\Model>|string $table
106+
* @param array<string, mixed> $data
107107
* @param string|null $connection
108108
* @param string|null $deletedAtColumn
109109
* @return $this
@@ -134,8 +134,8 @@ protected function assertSoftDeleted($table, array $data = [], $connection = nul
134134
/**
135135
* Assert the given record has not been "soft deleted".
136136
*
137-
* @param \Illuminate\Database\Eloquent\Model|string $table
138-
* @param array $data
137+
* @param \Illuminate\Database\Eloquent\Model|class-string<\Illuminate\Database\Eloquent\Model>|string $table
138+
* @param array<string, mixed> $data
139139
* @param string|null $connection
140140
* @param string|null $deletedAtColumn
141141
* @return $this
@@ -166,7 +166,7 @@ protected function assertNotSoftDeleted($table, array $data = [], $connection =
166166
/**
167167
* Assert the given model exists in the database.
168168
*
169-
* @param \Illuminate\Database\Eloquent\Model $model
169+
* @param \Illuminate\Database\Eloquent\Model|class-string<\Illuminate\Database\Eloquent\Model>|string $model
170170
* @return $this
171171
*/
172172
protected function assertModelExists($model)
@@ -177,7 +177,7 @@ protected function assertModelExists($model)
177177
/**
178178
* Assert the given model does not exist in the database.
179179
*
180-
* @param \Illuminate\Database\Eloquent\Model $model
180+
* @param \Illuminate\Database\Eloquent\Model|class-string<\Illuminate\Database\Eloquent\Model>|string $model
181181
* @return $this
182182
*/
183183
protected function assertModelMissing($model)
@@ -255,7 +255,7 @@ public function castAsJson($value, $connection = null)
255255
* Get the database connection.
256256
*
257257
* @param string|null $connection
258-
* @param string|null $table
258+
* @param \Illuminate\Database\Eloquent\Model|class-string<\Illuminate\Database\Eloquent\Model>|string $table
259259
* @return \Illuminate\Database\Connection
260260
*/
261261
protected function getConnection($connection = null, $table = null)
@@ -270,7 +270,7 @@ protected function getConnection($connection = null, $table = null)
270270
/**
271271
* Get the table name from the given model or string.
272272
*
273-
* @param \Illuminate\Database\Eloquent\Model|string $table
273+
* @param \Illuminate\Database\Eloquent\Model|class-string<\Illuminate\Database\Eloquent\Model>|string $table
274274
* @return string
275275
*/
276276
protected function getTable($table)
@@ -285,7 +285,7 @@ protected function getTable($table)
285285
/**
286286
* Get the table connection specified in the given model.
287287
*
288-
* @param \Illuminate\Database\Eloquent\Model|string $table
288+
* @param \Illuminate\Database\Eloquent\Model|class-string<\Illuminate\Database\Eloquent\Model>|string $table
289289
* @return string|null
290290
*/
291291
protected function getTableConnection($table)
@@ -300,7 +300,7 @@ protected function getTableConnection($table)
300300
/**
301301
* Get the table column name used for soft deletes.
302302
*
303-
* @param string $table
303+
* @param \Illuminate\Database\Eloquent\Model|class-string<\Illuminate\Database\Eloquent\Model>|string $table
304304
* @param string $defaultColumnName
305305
* @return string
306306
*/
@@ -312,7 +312,7 @@ protected function getDeletedAtColumn($table, $defaultColumnName = 'deleted_at')
312312
/**
313313
* Get the model entity from the given model or string.
314314
*
315-
* @param \Illuminate\Database\Eloquent\Model|string $table
315+
* @param \Illuminate\Database\Eloquent\Model|class-string<\Illuminate\Database\Eloquent\Model>|string $table
316316
* @return \Illuminate\Database\Eloquent\Model|null
317317
*/
318318
protected function newModelFor($table)
@@ -323,7 +323,7 @@ protected function newModelFor($table)
323323
/**
324324
* Seed a given database connection.
325325
*
326-
* @param array|string $class
326+
* @param list<string>|class-string<\Illuminate\Database\Seeder>|string $class
327327
* @return $this
328328
*/
329329
public function seed($class = 'Database\\Seeders\\DatabaseSeeder')

‎src/Illuminate/Foundation/Testing/Concerns/InteractsWithExceptionHandling.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ protected function withExceptionHandling()
4444
/**
4545
* Only handle the given exceptions via the exception handler.
4646
*
47-
* @param array $exceptions
47+
* @param list<class-string<\Throwable>> $exceptions
4848
* @return $this
4949
*/
5050
protected function handleExceptions(array $exceptions)
@@ -65,7 +65,7 @@ protected function handleValidationExceptions()
6565
/**
6666
* Disable exception handling for the test.
6767
*
68-
* @param array $except
68+
* @param list<class-string<\Throwable>> $except
6969
* @return $this
7070
*/
7171
protected function withoutExceptionHandling(array $except = [])
@@ -87,7 +87,7 @@ protected function withoutExceptionHandling(array $except = [])
8787
* Create a new class instance.
8888
*
8989
* @param \Illuminate\Contracts\Debug\ExceptionHandler $originalHandler
90-
* @param array $except
90+
* @param list<class-string<\Throwable>> $except
9191
* @return void
9292
*/
9393
public function __construct($originalHandler, $except = [])
@@ -113,7 +113,7 @@ public function report(Throwable $e)
113113
* Determine if the exception should be reported.
114114
*
115115
* @param \Throwable $e
116-
* @return bool
116+
* @return false
117117
*/
118118
public function shouldReport(Throwable $e)
119119
{
@@ -172,7 +172,7 @@ public function renderForConsole($output, Throwable $e)
172172
* Assert that the given callback throws an exception with the given message when invoked.
173173
*
174174
* @param \Closure $test
175-
* @param \Closure|class-string<\Throwable> $expectedClass
175+
* @param (\Closure(\Throwable): bool)|class-string<\Throwable> $expectedClass
176176
* @param string|null $expectedMessage
177177
* @return $this
178178
*/

‎src/Illuminate/Notifications/Channels/DatabaseChannel.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ protected function buildPayload($notifiable, Notification $notification)
3636
? $notification->databaseType($notifiable)
3737
: get_class($notification),
3838
'data' => $this->getData($notifiable, $notification),
39-
'read_at' => null,
39+
'read_at' => method_exists($notification, 'initialDatabaseReadAtValue')
40+
? $notification->initialDatabaseReadAtValue($notifiable)
41+
: null,
4042
];
4143
}
4244

‎src/Illuminate/Support/Testing/Fakes/ExceptionHandlerFake.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class ExceptionHandlerFake implements ExceptionHandler, Fake
2323
/**
2424
* All of the exceptions that have been reported.
2525
*
26-
* @var array<int, \Throwable>
26+
* @var list<\Throwable>
2727
*/
2828
protected $reported = [];
2929

@@ -38,7 +38,7 @@ class ExceptionHandlerFake implements ExceptionHandler, Fake
3838
* Create a new exception handler fake.
3939
*
4040
* @param \Illuminate\Contracts\Debug\ExceptionHandler $handler
41-
* @param array<int, class-string<\Throwable>> $exceptions
41+
* @param list<class-string<\Throwable>> $exceptions
4242
* @return void
4343
*/
4444
public function __construct(
@@ -61,7 +61,7 @@ public function handler()
6161
/**
6262
* Assert if an exception of the given type has been reported.
6363
*
64-
* @param \Closure|string $exception
64+
* @param (\Closure(\Throwable): bool)|class-string<\Throwable> $exception
6565
* @return void
6666
*/
6767
public function assertReported(Closure|string $exception)
@@ -107,7 +107,7 @@ public function assertReportedCount(int $count)
107107
/**
108108
* Assert if an exception of the given type has not been reported.
109109
*
110-
* @param \Closure|string $exception
110+
* @param (\Closure(\Throwable): bool)|class-string<\Throwable> $exception
111111
* @return void
112112
*/
113113
public function assertNotReported(Closure|string $exception)
@@ -263,7 +263,7 @@ public function setHandler(ExceptionHandler $handler)
263263
}
264264

265265
/**
266-
* Handle dynamic method calls to the mailer.
266+
* Handle dynamic method calls to the handler.
267267
*
268268
* @param string $method
269269
* @param array<string, mixed> $parameters

‎src/Illuminate/Testing/Constraints/HasInDatabase.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ class HasInDatabase extends Constraint
2525
/**
2626
* The data that will be used to narrow the search in the database table.
2727
*
28-
* @var array
28+
* @var array<string, mixed>
2929
*/
3030
protected $data;
3131

3232
/**
3333
* Create a new constraint instance.
3434
*
3535
* @param \Illuminate\Database\Connection $database
36-
* @param array $data
36+
* @param array<string, mixed> $data
3737
* @return void
3838
*/
3939
public function __construct(Connection $database, array $data)

0 commit comments

Comments
 (0)
Failed to load comments.