Skip to content

Commit f924dd2

Browse files
committed
Merge branch '3.8.x' into 4.0.x
* 3.8.x: Make AbstractSchemaManager covariant to its template argument
2 parents 2fe8216 + 8a7e9b7 commit f924dd2

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

src/Schema/AbstractSchemaManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* Base class for schema managers. Schema managers are used to inspect and/or
2424
* modify the database schema/structure.
2525
*
26-
* @template T of AbstractPlatform
26+
* @template-covariant T of AbstractPlatform
2727
*/
2828
abstract class AbstractSchemaManager
2929
{
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Doctrine\StaticAnalysis\DBAL;
6+
7+
use Doctrine\DBAL\Connection;
8+
use Doctrine\DBAL\Driver\PDO\PgSQL\Driver;
9+
use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory;
10+
use Doctrine\DBAL\Schema\PostgreSQLSchemaManager;
11+
use Exception;
12+
13+
$smf = new DefaultSchemaManagerFactory();
14+
$schemaManager = $smf->createSchemaManager(new Connection([], new Driver()));
15+
16+
if (!$schemaManager instanceof PostgreSQLSchemaManager) {
17+
throw new Exception('should not happen');
18+
}

0 commit comments

Comments
 (0)