Skip to content

Commit e652a6b

Browse files
committed
Merge branch '8.x'
# Conflicts: # CHANGELOG-6.x.md # CHANGELOG-8.x.md # src/Illuminate/Broadcasting/Broadcasters/AblyBroadcaster.php # src/Illuminate/Collections/Traits/EnumeratesValues.php # src/Illuminate/Database/DBAL/TimestampType.php # src/Illuminate/Database/Eloquent/Builder.php # src/Illuminate/Filesystem/FilesystemAdapter.php # src/Illuminate/Foundation/Application.php # src/Illuminate/Mail/Transport/MailgunTransport.php # src/Illuminate/Mail/Transport/SesTransport.php # tests/Http/HttpClientTest.php
2 parents 78d761e + 5321e34 commit e652a6b

File tree

61 files changed

+1454
-74
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1454
-74
lines changed

src/Illuminate/Broadcasting/Broadcasters/AblyBroadcaster.php

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Ably\AblyRest;
66
use Ably\Exceptions\AblyException;
7+
use Ably\Models\Message as AblyMessage;
78
use Illuminate\Broadcasting\BroadcastException;
89
use Illuminate\Support\Str;
910
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
@@ -126,7 +127,9 @@ public function broadcast(array $channels, $event, array $payload = [])
126127
{
127128
try {
128129
foreach ($this->formatChannels($channels) as $channel) {
129-
$this->ably->channels->get($channel)->publish($event, $payload);
130+
$this->ably->channels->get($channel)->publish(
131+
$this->buildAblyMessage($event, $payload)
132+
);
130133
}
131134
} catch (AblyException $e) {
132135
throw new BroadcastException(
@@ -135,6 +138,22 @@ public function broadcast(array $channels, $event, array $payload = [])
135138
}
136139
}
137140

141+
/**
142+
* Build an Ably message object for broadcasting.
143+
*
144+
* @param string $event
145+
* @param array $payload
146+
* @return \Ably\Models\Message
147+
*/
148+
protected function buildAblyMessage($event, array $payload = [])
149+
{
150+
return tap(new AblyMessage, function ($message) use ($event, $payload) {
151+
$message->name = $event;
152+
$message->data = $payload;
153+
$message->connectionKey = data_get($payload, 'socket');
154+
});
155+
}
156+
138157
/**
139158
* Return true if the channel is protected by authentication.
140159
*

src/Illuminate/Cache/Repository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ public function getStore()
578578
/**
579579
* Fire an event for this cache instance.
580580
*
581-
* @param string $event
581+
* @param object|string $event
582582
* @return void
583583
*/
584584
protected function event($event)

src/Illuminate/Cache/TaggedCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function taggedItemKey($key)
105105
/**
106106
* Fire an event for this cache instance.
107107
*
108-
* @param string $event
108+
* @param \Illuminate\Cache\Events\CacheEvent $event
109109
* @return void
110110
*/
111111
protected function event($event)

src/Illuminate/Collections/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,7 @@ protected function sortByMany(array $comparisons = [])
13501350

13511351
$result = 0;
13521352

1353-
if (is_callable($prop)) {
1353+
if (! is_string($prop) && is_callable($prop)) {
13541354
$result = $prop($a, $b);
13551355
} else {
13561356
$values = [data_get($a, $prop), data_get($b, $prop)];

src/Illuminate/Collections/Traits/EnumeratesValues.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,22 @@ public function pipeInto($class)
720720
return new $class($this);
721721
}
722722

723+
/**
724+
* Pass the collection through a series of callable pipes and return the result.
725+
*
726+
* @param array<callable> $pipes
727+
* @return mixed
728+
*/
729+
public function pipeThrough($pipes)
730+
{
731+
return static::make($pipes)->reduce(
732+
function ($carry, $pipe) {
733+
return $pipe($carry);
734+
},
735+
$this,
736+
);
737+
}
738+
723739
/**
724740
* Reduce the collection to a single value.
725741
*

src/Illuminate/Console/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ protected function parseCommand($command, $parameters)
218218
$input = new ArrayInput($parameters);
219219
}
220220

221-
return [$command, $input ?? null];
221+
return [$command, $input];
222222
}
223223

224224
/**
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
namespace Illuminate\Console\Scheduling;
4+
5+
use Illuminate\Console\Command;
6+
7+
class ScheduleClearCacheCommand extends Command
8+
{
9+
/**
10+
* The console command name.
11+
*
12+
* @var string
13+
*/
14+
protected $name = 'schedule:clear-cache';
15+
16+
/**
17+
* The console command description.
18+
*
19+
* @var string
20+
*/
21+
protected $description = 'Delete the cached mutex files created by scheduler';
22+
23+
/**
24+
* Execute the console command.
25+
*
26+
* @param \Illuminate\Console\Scheduling\Schedule $schedule
27+
* @return void
28+
*/
29+
public function handle(Schedule $schedule)
30+
{
31+
$mutexCleared = false;
32+
33+
foreach ($schedule->events($this->laravel) as $event) {
34+
if ($event->mutex->exists($event)) {
35+
$this->line('<info>Deleting mutex for:</info> '.$event->command);
36+
37+
$event->mutex->forget($event);
38+
39+
$mutexCleared = true;
40+
}
41+
}
42+
43+
if (! $mutexCleared) {
44+
$this->info('No mutex files were found.');
45+
}
46+
}
47+
}

src/Illuminate/Container/BoundMethod.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,15 @@ protected static function addDependencyForCallParameter($container, $parameter,
172172

173173
unset($parameters[$className]);
174174
} else {
175-
$dependencies[] = $container->make($className);
175+
if ($parameter->isVariadic()) {
176+
$variadicDependencies = $container->make($className);
177+
178+
$dependencies = array_merge($dependencies, is_array($variadicDependencies)
179+
? $variadicDependencies
180+
: [$variadicDependencies]);
181+
} else {
182+
$dependencies[] = $container->make($className);
183+
}
176184
}
177185
} elseif ($parameter->isDefaultValueAvailable()) {
178186
$dependencies[] = $parameter->getDefaultValue();

src/Illuminate/Database/Connection.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Closure;
66
use DateTimeInterface;
77
use Doctrine\DBAL\Connection as DoctrineConnection;
8+
use Doctrine\DBAL\Types\Type;
89
use Exception;
910
use Illuminate\Contracts\Events\Dispatcher;
1011
use Illuminate\Database\Events\QueryExecuted;
@@ -21,6 +22,7 @@
2122
use LogicException;
2223
use PDO;
2324
use PDOStatement;
25+
use RuntimeException;
2426

2527
class Connection implements ConnectionInterface
2628
{
@@ -1007,6 +1009,34 @@ public function getDoctrineConnection()
10071009
return $this->doctrineConnection;
10081010
}
10091011

1012+
/**
1013+
* Register a custom Doctrine mapping type.
1014+
*
1015+
* @param string $class
1016+
* @param string $name
1017+
* @param string $type
1018+
* @return void
1019+
*
1020+
* @throws \Doctrine\DBAL\DBALException
1021+
* @throws \RuntimeException
1022+
*/
1023+
public function registerDoctrineType(string $class, string $name, string $type): void
1024+
{
1025+
if (! $this->isDoctrineAvailable()) {
1026+
throw new RuntimeException(
1027+
'Registering a custom Doctrine type requires Doctrine DBAL (doctrine/dbal).'
1028+
);
1029+
}
1030+
1031+
if (! Type::hasType($name)) {
1032+
Type::addType($name, $class);
1033+
}
1034+
1035+
$this->getDoctrineSchemaManager()
1036+
->getDatabasePlatform()
1037+
->registerDoctrineTypeMapping($type, $name);
1038+
}
1039+
10101040
/**
10111041
* Get the current PDO connection.
10121042
*

src/Illuminate/Database/Console/DbCommand.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,16 @@ public function getConnection()
6767
}
6868

6969
if ($this->option('read')) {
70+
if (is_array($connection['read']['host'])) {
71+
$connection['read']['host'] = $connection['read']['host'][0];
72+
}
73+
7074
$connection = array_merge($connection, $connection['read']);
7175
} elseif ($this->option('write')) {
76+
if (is_array($connection['write']['host'])) {
77+
$connection['write']['host'] = $connection['write']['host'][0];
78+
}
79+
7280
$connection = array_merge($connection, $connection['write']);
7381
}
7482

0 commit comments

Comments
 (0)