Merge branch '4.0.x' into 4.1.x

* 4.0.x:
  Make AbstractSchemaManager covariant to its template argument
This commit is contained in:
Alexander M. Turek
2024-08-02 11:32:41 +02:00
2 changed files with 19 additions and 1 deletions

View File

@@ -23,7 +23,7 @@ use function strtolower;
* Base class for schema managers. Schema managers are used to inspect and/or
* modify the database schema/structure.
*
* @template T of AbstractPlatform
* @template-covariant T of AbstractPlatform
*/
abstract class AbstractSchemaManager
{

View File

@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
namespace Doctrine\StaticAnalysis\DBAL;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver\PDO\PgSQL\Driver;
use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory;
use Doctrine\DBAL\Schema\PostgreSQLSchemaManager;
use Exception;
$smf = new DefaultSchemaManagerFactory();
$schemaManager = $smf->createSchemaManager(new Connection([], new Driver()));
if (!$schemaManager instanceof PostgreSQLSchemaManager) {
throw new Exception('should not happen');
}