Skip to content

Commit c5a7c14

Browse files
Merge branch '10.x'
2 parents c39a156 + aa18c13 commit c5a7c14

34 files changed

+420
-64
lines changed

src/Illuminate/Cache/RedisStore.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ public function flush()
253253
/**
254254
* Remove all expired tag set entries.
255255
*
256-
* @return bool
256+
* @return void
257257
*/
258258
public function flushStaleTags()
259259
{

src/Illuminate/Collections/Traits/EnumeratesValues.php

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -955,21 +955,17 @@ protected function getArrayableItems($items)
955955
{
956956
if (is_array($items)) {
957957
return $items;
958-
} elseif ($items instanceof Enumerable) {
959-
return $items->all();
960-
} elseif ($items instanceof Arrayable) {
961-
return $items->toArray();
962-
} elseif ($items instanceof Traversable) {
963-
return iterator_to_array($items);
964-
} elseif ($items instanceof Jsonable) {
965-
return json_decode($items->toJson(), true);
966-
} elseif ($items instanceof JsonSerializable) {
967-
return (array) $items->jsonSerialize();
968-
} elseif ($items instanceof UnitEnum) {
969-
return [$items];
970958
}
971959

972-
return (array) $items;
960+
return match (true) {
961+
$items instanceof Enumerable => $items->all(),
962+
$items instanceof Arrayable => $items->toArray(),
963+
$items instanceof Traversable => iterator_to_array($items),
964+
$items instanceof Jsonable => json_decode($items->toJson(), true),
965+
$items instanceof JsonSerializable => (array) $items->jsonSerialize(),
966+
$items instanceof UnitEnum => [$items],
967+
default => (array) $items,
968+
};
973969
}
974970

975971
/**

src/Illuminate/Console/Signals.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ protected function initializeSignal($signal)
8484
/**
8585
* Unregister the current signal handlers.
8686
*
87-
* @return array<int, array<int, callable(int $signal): void>>
87+
* @return void
8888
*/
8989
public function unregister()
9090
{

src/Illuminate/Contracts/Events/Dispatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function subscribe($subscriber);
3434
*
3535
* @param string|object $event
3636
* @param mixed $payload
37-
* @return array|null
37+
* @return mixed
3838
*/
3939
public function until($event, $payload = []);
4040

src/Illuminate/Database/Console/DumpCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class DumpCommand extends Command
3636
*
3737
* @param \Illuminate\Database\ConnectionResolverInterface $connections
3838
* @param \Illuminate\Contracts\Events\Dispatcher $dispatcher
39-
* @return int
39+
* @return void
4040
*/
4141
public function handle(ConnectionResolverInterface $connections, Dispatcher $dispatcher)
4242
{

src/Illuminate/Database/Console/Migrations/MigrateMakeCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function handle()
103103
* @param string $name
104104
* @param string $table
105105
* @param bool $create
106-
* @return string
106+
* @return void
107107
*/
108108
protected function writeMigration($name, $table, $create)
109109
{

src/Illuminate/Database/Eloquent/Model.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ public function loadMissing($relations)
746746
*
747747
* @param array|string $relations
748748
* @param string $column
749-
* @param string $function
749+
* @param string|null $function
750750
* @return $this
751751
*/
752752
public function loadAggregate($relations, $column, $function = null)
@@ -834,7 +834,7 @@ public function loadExists($relations)
834834
* @param string $relation
835835
* @param array $relations
836836
* @param string $column
837-
* @param string $function
837+
* @param string|null $function
838838
* @return $this
839839
*/
840840
public function loadMorphAggregate($relation, $relations, $column, $function = null)

src/Illuminate/Database/Query/Grammars/Grammar.php

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -754,23 +754,16 @@ protected function compileHaving(array $having)
754754
// If the having clause is "raw", we can just return the clause straight away
755755
// without doing any more processing on it. Otherwise, we will compile the
756756
// clause into SQL based on the components that make it up from builder.
757-
if ($having['type'] === 'Raw') {
758-
return $having['sql'];
759-
} elseif ($having['type'] === 'between') {
760-
return $this->compileHavingBetween($having);
761-
} elseif ($having['type'] === 'Null') {
762-
return $this->compileHavingNull($having);
763-
} elseif ($having['type'] === 'NotNull') {
764-
return $this->compileHavingNotNull($having);
765-
} elseif ($having['type'] === 'bit') {
766-
return $this->compileHavingBit($having);
767-
} elseif ($having['type'] === 'Expression') {
768-
return $this->compileHavingExpression($having);
769-
} elseif ($having['type'] === 'Nested') {
770-
return $this->compileNestedHavings($having);
771-
}
772-
773-
return $this->compileBasicHaving($having);
757+
return match ($having['type']) {
758+
'Raw' => $having['sql'],
759+
'between' => $this->compileHavingBetween($having),
760+
'Null' => $this->compileHavingNull($having),
761+
'NotNull' => $this->compileHavingNotNull($having),
762+
'bit' => $this->compileHavingBit($having),
763+
'Expression' => $this->compileHavingExpression($having),
764+
'Nested' => $this->compileNestedHavings($having),
765+
default => $this->compileBasicHaving($having),
766+
};
774767
}
775768

776769
/**

src/Illuminate/Events/Dispatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ protected function resolveSubscriber($subscriber)
215215
*
216216
* @param string|object $event
217217
* @param mixed $payload
218-
* @return array|null
218+
* @return mixed
219219
*/
220220
public function until($event, $payload = [])
221221
{

src/Illuminate/Events/NullDispatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function push($event, $payload = [])
5757
*
5858
* @param string|object $event
5959
* @param mixed $payload
60-
* @return array|null
60+
* @return mixed
6161
*/
6262
public function until($event, $payload = [])
6363
{

0 commit comments

Comments
 (0)