Skip to content

Commit b66d98a

Browse files
committed
Merge branch '9.x'
# Conflicts: # composer.json # src/Illuminate/Foundation/Application.php # src/Illuminate/Queue/composer.json # src/Illuminate/Support/composer.json
2 parents 746d732 + f2c51fd commit b66d98a

File tree

13 files changed

+195
-10
lines changed

13 files changed

+195
-10
lines changed

.github/workflows/tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
with:
6666
timeout_minutes: 5
6767
max_attempts: 5
68-
command: composer require ramsey/collection:^1.2 brick/math:^0.9.3 symfony/css-selector:^6.0 --no-interaction --no-update
68+
command: composer require brick/math:^0.9.3 symfony/css-selector:^6.0 --no-interaction --no-update
6969
if: matrix.php >= 8.1
7070

7171
- name: Set Minimum PHP 8.2 Versions
@@ -142,7 +142,7 @@ jobs:
142142
with:
143143
timeout_minutes: 5
144144
max_attempts: 5
145-
command: composer require ramsey/collection:~1.2 brick/math:~0.9.3 symfony/css-selector:~6.0 --no-interaction --no-update
145+
command: composer require brick/math:~0.9.3 symfony/css-selector:~6.0 --no-interaction --no-update
146146
if: matrix.php >= 8.1
147147

148148
- name: Set Minimum PHP 8.2 Versions

bin/facades.php

Lines changed: 82 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,18 @@ function resolveDocMixins($class)
318318
->flatMap(fn ($mixin) => [$mixin, ...resolveDocMixins($mixin)]);
319319
}
320320

321+
/**
322+
* Resolve the classes referenced methods in the @methods docblocks.
323+
*
324+
* @param \ReflectionMethodDecorator $method
325+
* @return \Illuminate\Support\Collection<int, string>
326+
*/
327+
function resolveDocParameters($method)
328+
{
329+
return resolveDocTags($method->getDocComment() ?: '', '@param')
330+
->map(fn ($tag) => Str::squish($tag));
331+
}
332+
321333
/**
322334
* Determine if the method is magic.
323335
*
@@ -428,7 +440,7 @@ function normaliseDetails($method)
428440
{
429441
return is_string($method) ? $method : [
430442
'name' => $method->getName(),
431-
'parameters' => collect($method->getParameters())
443+
'parameters' => resolveParameters($method)
432444
->map(fn ($parameter) => [
433445
'name' => '$'.$parameter->getName(),
434446
'optional' => $parameter->isOptional() && ! $parameter->isVariadic(),
@@ -442,6 +454,21 @@ function normaliseDetails($method)
442454
];
443455
}
444456

457+
/**
458+
* Resolve the parameters for the method.
459+
*
460+
* @param \ReflectionMethodDecorator $method
461+
* @return \Illuminate\Support\Collection<int, \ReflectionParameter|\DynamicParameter>
462+
*/
463+
function resolveParameters($method)
464+
{
465+
$dynamicParameters = resolveDocParameters($method)
466+
->skip($method->getNumberOfParameters())
467+
->mapInto(DynamicParameter::class);
468+
469+
return collect($method->getParameters())->merge($dynamicParameters);
470+
}
471+
445472
/**
446473
* Resolve the default value for the parameter.
447474
*
@@ -505,3 +532,57 @@ public function sourceClass()
505532
return new ReflectionClass($this->sourceClass);
506533
}
507534
}
535+
536+
class DynamicParameter
537+
{
538+
/**
539+
* @param string $definition
540+
*/
541+
public function __construct(private $definition)
542+
{
543+
//
544+
}
545+
546+
/**
547+
* @return string
548+
*/
549+
public function getName()
550+
{
551+
return Str::of($this->definition)
552+
->after('$')
553+
->before(' ')
554+
->toString();
555+
}
556+
557+
/**
558+
* @return bool
559+
*/
560+
public function isOptional()
561+
{
562+
return true;
563+
}
564+
565+
/**
566+
* @return bool
567+
*/
568+
public function isVariadic()
569+
{
570+
return Str::contains($this->definition, " ...\${$this->getName()}");
571+
}
572+
573+
/**
574+
* @return bool
575+
*/
576+
public function isDefaultValueAvailable()
577+
{
578+
return true;
579+
}
580+
581+
/**
582+
* @return null
583+
*/
584+
public function getDefaultValue()
585+
{
586+
return null;
587+
}
588+
}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"psr/container": "^1.1.1|^2.0.1",
3232
"psr/log": "^1.0|^2.0|^3.0",
3333
"psr/simple-cache": "^1.0|^2.0|^3.0",
34-
"ramsey/uuid": "^4.5",
34+
"ramsey/uuid": "^4.7",
3535
"symfony/console": "^6.2",
3636
"symfony/error-handler": "^6.2",
3737
"symfony/finder": "^6.2",

src/Illuminate/Database/Query/Builder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,6 +1028,10 @@ public function whereIn($column, $values, $boolean = 'and', $not = false)
10281028

10291029
$this->wheres[] = compact('type', 'column', 'values', 'boolean');
10301030

1031+
if (count($values) !== count(Arr::flatten($values, 1))) {
1032+
throw new InvalidArgumentException('Nested arrays may not be passed to whereIn method.');
1033+
}
1034+
10311035
// Finally, we'll add a binding for each value unless that value is an expression
10321036
// in which case we will just skip over it since it will be the query as a raw
10331037
// string and not as a parameterized place-holder to be replaced by the PDO.

src/Illuminate/Mail/resources/views/html/button.blade.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
@props([
22
'url',
33
'color' => 'primary',
4+
'align' => 'center',
45
])
5-
<table class="action" align="center" width="100%" cellpadding="0" cellspacing="0" role="presentation">
6+
<table class="action" align="{{ $align }}" width="100%" cellpadding="0" cellspacing="0" role="presentation">
67
<tr>
7-
<td align="center">
8+
<td align="{{ $align }}">
89
<table width="100%" border="0" cellpadding="0" cellspacing="0" role="presentation">
910
<tr>
10-
<td align="center">
11+
<td align="{{ $align }}">
1112
<table border="0" cellpadding="0" cellspacing="0" role="presentation">
1213
<tr>
1314
<td>

src/Illuminate/Queue/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"illuminate/pipeline": "^10.0",
2626
"illuminate/support": "^10.0",
2727
"laravel/serializable-closure": "^1.2.2",
28-
"ramsey/uuid": "^4.5",
28+
"ramsey/uuid": "^4.7",
2929
"symfony/process": "^6.2"
3030
},
3131
"autoload": {

src/Illuminate/Routing/CreatesRegularExpressionRouteConstraints.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ public function whereNumber($parameters)
3939
return $this->assignExpressionToParameters($parameters, '[0-9]+');
4040
}
4141

42+
/**
43+
* Specify that the given route parameters must be ULIDs.
44+
*
45+
* @param array|string $parameters
46+
* @return $this
47+
*/
48+
public function whereUlid($parameters)
49+
{
50+
return $this->assignExpressionToParameters($parameters, '[0-7][0-9a-hjkmnp-tv-zA-HJKMNP-TV-Z]{25}');
51+
}
52+
4253
/**
4354
* Specify that the given route parameters must be UUIDs.
4455
*

src/Illuminate/Support/Facades/Http.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
* @method static \Illuminate\Http\Client\PendingRequest withMiddleware(callable $middleware)
5050
* @method static \Illuminate\Http\Client\PendingRequest beforeSending(callable $callback)
5151
* @method static \Illuminate\Http\Client\PendingRequest throw(callable|null $callback = null)
52-
* @method static \Illuminate\Http\Client\PendingRequest throwIf(callable|bool $condition)
52+
* @method static \Illuminate\Http\Client\PendingRequest throwIf(callable|bool $condition, callable|null $throwCallback = null)
5353
* @method static \Illuminate\Http\Client\PendingRequest throwUnless(bool $condition)
5454
* @method static \Illuminate\Http\Client\PendingRequest dump()
5555
* @method static \Illuminate\Http\Client\PendingRequest dd()

src/Illuminate/Support/Facades/Route.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
* @method static \Illuminate\Routing\RouteRegistrar whereAlpha(array|string $parameters)
8484
* @method static \Illuminate\Routing\RouteRegistrar whereAlphaNumeric(array|string $parameters)
8585
* @method static \Illuminate\Routing\RouteRegistrar whereNumber(array|string $parameters)
86+
* @method static \Illuminate\Routing\RouteRegistrar whereUlid(array|string $parameters)
8687
* @method static \Illuminate\Routing\RouteRegistrar whereUuid(array|string $parameters)
8788
* @method static \Illuminate\Routing\RouteRegistrar whereIn(array|string $parameters, array $values)
8889
* @method static \Illuminate\Routing\RouteRegistrar as(string $value)

src/Illuminate/Support/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"suggest": {
4545
"illuminate/filesystem": "Required to use the composer class (^10.0).",
4646
"league/commonmark": "Required to use Str::markdown() and Stringable::markdown() (^2.0.2).",
47-
"ramsey/uuid": "Required to use Str::uuid() (^4.5).",
47+
"ramsey/uuid": "Required to use Str::uuid() (^4.7).",
4848
"symfony/process": "Required to use the composer class (^6.2).",
4949
"symfony/uid": "Required to use Str::ulid() (^6.2).",
5050
"symfony/var-dumper": "Required to use the dd function (^6.2).",

0 commit comments

Comments
 (0)