diff --git a/src/Schema/AbstractSchemaManager.php b/src/Schema/AbstractSchemaManager.php index 7e1fd93ff2d..039c9a8044e 100644 --- a/src/Schema/AbstractSchemaManager.php +++ b/src/Schema/AbstractSchemaManager.php @@ -31,7 +31,7 @@ * 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 { diff --git a/static-analysis/abstract-schema-manager-covariant-template.php b/static-analysis/abstract-schema-manager-covariant-template.php new file mode 100644 index 00000000000..7223888cb31 --- /dev/null +++ b/static-analysis/abstract-schema-manager-covariant-template.php @@ -0,0 +1,18 @@ +createSchemaManager(new Connection([], new Driver())); + +if (!$schemaManager instanceof PostgreSQLSchemaManager) { + throw new Exception('should not happen'); +}