-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6334 from zerkms/patch-2
Make AbstractSchemaManager covariant to its template argument
- Loading branch information
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
static-analysis/abstract-schema-manager-covariant-template.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'); | ||
} |