Skip to content

Commit cc03211

Browse files
committed
Merge branch '8.x'
# Conflicts: # .github/workflows/tests.yml # composer.json # src/Illuminate/Broadcasting/composer.json # src/Illuminate/Collections/Collection.php # src/Illuminate/Console/Scheduling/ScheduleListCommand.php # src/Illuminate/Database/Query/Builder.php # src/Illuminate/Support/composer.json
2 parents 5d8eb84 + 92ce2b9 commit cc03211

37 files changed

+706
-39
lines changed

.github/CODEOWNERS

Lines changed: 0 additions & 4 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050
with:
5151
php-version: ${{ matrix.php }}
5252
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, redis, memcached
53+
ini-values: error_reporting=E_ALL
5354
tools: composer:v2
5455
coverage: none
5556

composer.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"symfony/routing": "^6.0",
4242
"symfony/var-dumper": "^6.0",
4343
"tijsverkoyen/css-to-inline-styles": "^2.2.2",
44-
"vlucas/phpdotenv": "^5.3",
44+
"vlucas/phpdotenv": "^5.4.1",
4545
"voku/portable-ascii": "^1.4.8"
4646
},
4747
"replace": {
@@ -138,7 +138,12 @@
138138
"ext-pcntl": "Required to use all features of the queue worker.",
139139
"ext-posix": "Required to use all features of the queue worker.",
140140
"ext-redis": "Required to use the Redis cache and queue drivers (^4.0|^5.0).",
141+
<<<<<<< HEAD
141142
"aws/aws-sdk-php": "Required to use the SQS queue driver and DynamoDb failed job storage (^3.198.1).",
143+
=======
144+
"ably/ably-php": "Required to use the Ably broadcast driver (^1.0).",
145+
"aws/aws-sdk-php": "Required to use the SQS queue driver, DynamoDb failed job storage and SES mail driver (^3.198.1).",
146+
>>>>>>> 8.x
142147
"brianium/paratest": "Required to run tests in parallel (^6.0).",
143148
"doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.13.3|^3.1.4).",
144149
"filp/whoops": "Required for friendly error pages in development (^2.14.3).",

src/Illuminate/Broadcasting/composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
}
3535
},
3636
"suggest": {
37+
"ably/ably-php": "Required to use the Ably broadcast driver (^1.0).",
3738
"pusher/pusher-php-server": "Required to use the Pusher broadcast driver (^6.0|^7.0)."
3839
},
3940
"config": {

src/Illuminate/Collections/Collection.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,7 +1663,11 @@ public function offsetSet($key, $value)
16631663
/**
16641664
* Unset the item at a given offset.
16651665
*
1666+
<<<<<<< HEAD
16661667
* @param TKey $key
1668+
=======
1669+
* @param mixed $key
1670+
>>>>>>> 8.x
16671671
* @return void
16681672
*/
16691673
#[\ReturnTypeWillChange]

src/Illuminate/Console/Scheduling/Schedule.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,11 @@ public function call($callback, array $parameters = [])
120120
public function command($command, array $parameters = [])
121121
{
122122
if (class_exists($command)) {
123-
$command = Container::getInstance()->make($command)->getName();
123+
$command = Container::getInstance()->make($command);
124+
125+
return $this->exec(
126+
Application::formatCommandString($command->getName()), $parameters,
127+
)->description($command->getDescription());
124128
}
125129

126130
return $this->exec(

src/Illuminate/Console/Scheduling/ScheduleListCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function handle(Schedule $schedule)
4040
$event->description,
4141
(new CronExpression($event->expression))
4242
->getNextRunDate(Carbon::now()->setTimezone($event->timezone))
43-
->setTimezone(new DateTimeZone($this->option('timezone', config('app.timezone'))))
43+
->setTimezone(new DateTimeZone($this->option('timezone') ?? config('app.timezone')))
4444
->format('Y-m-d H:i:s P'),
4545
];
4646
}

src/Illuminate/Contracts/Database/Query/Builder.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,25 @@ public function whereJsonLength($column, $operator, $value = null, $boolean = 'a
713713
*/
714714
public function orWhereJsonLength($column, $operator, $value = null);
715715

716+
/**
717+
* Add a "where fulltext" clause to the query.
718+
*
719+
* @param string|string[] $columns
720+
* @param string $value
721+
* @param string $boolean
722+
* @return $this
723+
*/
724+
public function whereFullText($columns, $value, array $options = [], $boolean = 'and');
725+
726+
/**
727+
* Add a "or where fulltext" clause to the query.
728+
*
729+
* @param string|string[] $columns
730+
* @param string $value
731+
* @return $this
732+
*/
733+
public function orWhereFullText($columns, $value, array $options = []);
734+
716735
/**
717736
* Add a "group by" clause to the query.
718737
*

src/Illuminate/Database/Connection.php

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,13 @@ class Connection implements ConnectionInterface
177177
*/
178178
protected $doctrineConnection;
179179

180+
/**
181+
* Type mappings that should be registered with new Doctrine connections.
182+
*
183+
* @var array
184+
*/
185+
protected $doctrineTypeMappings = [];
186+
180187
/**
181188
* The connection resolvers.
182189
*
@@ -1004,6 +1011,12 @@ public function getDoctrineConnection()
10041011
'driver' => $driver->getName(),
10051012
'serverVersion' => $this->getConfig('server_version'),
10061013
]), $driver);
1014+
1015+
foreach ($this->doctrineTypeMappings as $name => $type) {
1016+
$this->doctrineConnection
1017+
->getDatabasePlatform()
1018+
->registerDoctrineTypeMapping($type, $name);
1019+
}
10071020
}
10081021

10091022
return $this->doctrineConnection;
@@ -1032,9 +1045,7 @@ public function registerDoctrineType(string $class, string $name, string $type):
10321045
Type::addType($name, $class);
10331046
}
10341047

1035-
$this->getDoctrineSchemaManager()
1036-
->getDatabasePlatform()
1037-
->registerDoctrineTypeMapping($type, $name);
1048+
$this->doctrineTypeMappings[$name] = $type;
10381049
}
10391050

10401051
/**

src/Illuminate/Database/DatabaseManager.php

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
namespace Illuminate\Database;
44

5+
use Doctrine\DBAL\Types\Type;
56
use Illuminate\Database\Connectors\ConnectionFactory;
67
use Illuminate\Support\Arr;
78
use Illuminate\Support\ConfigurationUrlParser;
89
use Illuminate\Support\Str;
910
use InvalidArgumentException;
1011
use PDO;
12+
use RuntimeException;
1113

1214
/**
1315
* @mixin \Illuminate\Database\Connection
@@ -49,6 +51,13 @@ class DatabaseManager implements ConnectionResolverInterface
4951
*/
5052
protected $reconnector;
5153

54+
/**
55+
* The custom Doctrine column types.
56+
*
57+
* @var array
58+
*/
59+
protected $doctrineTypes = [];
60+
5261
/**
5362
* Create a new database manager instance.
5463
*
@@ -207,16 +216,46 @@ protected function setPdoForType(Connection $connection, $type = null)
207216
}
208217

209218
/**
210-
* Register custom Doctrine types from the configuration with the connection.
219+
* Register custom Doctrine types with the connection.
211220
*
212221
* @param \Illuminate\Database\Connection $connection
213222
* @return void
214223
*/
215224
protected function registerConfiguredDoctrineTypes(Connection $connection): void
216225
{
217226
foreach ($this->app['config']->get('database.dbal.types', []) as $name => $class) {
218-
$connection->registerDoctrineType($class, $name, $name);
227+
$this->registerDoctrineType($class, $name, $name);
228+
}
229+
230+
foreach ($this->doctrineTypes as $name => [$type, $class]) {
231+
$connection->registerDoctrineType($class, $name, $type);
232+
}
233+
}
234+
235+
/**
236+
* Register a custom Doctrine type.
237+
*
238+
* @param string $class
239+
* @param string $name
240+
* @param string $type
241+
* @return void
242+
*
243+
* @throws \Doctrine\DBAL\DBALException
244+
* @throws \RuntimeException
245+
*/
246+
public function registerDoctrineType(string $class, string $name, string $type): void
247+
{
248+
if (! class_exists('Doctrine\DBAL\Connection')) {
249+
throw new RuntimeException(
250+
'Registering a custom Doctrine type requires Doctrine DBAL (doctrine/dbal).'
251+
);
219252
}
253+
254+
if (! Type::hasType($name)) {
255+
Type::addType($name, $class);
256+
}
257+
258+
$this->doctrineTypes[$name] = [$type, $class];
220259
}
221260

222261
/**

0 commit comments

Comments
 (0)