@@ -24,20 +24,23 @@ public function create(): void {
2424 $ tree ->addColumn ("right_pos " , "integer " , ["unsigned " => TRUE ]);
2525 $ tree ->addColumn ("depth " , "integer " , ["unsigned " => TRUE ]);
2626
27- if (\class_exists ('\Doctrine\DBAL\Schema\Name\UnqualifiedName ' )) {
27+ // @phpstan-ignore function.alreadyNarrowedType
28+ if (\method_exists ($ tree , 'addPrimaryKeyConstraint ' )) {
2829 // doctrine/dbal 4.
29- // @phpstan-ignore-next-line
30- $ tree ->addPrimaryKeyConstraint (new PrimaryKeyConstraint (
31- UnqualifiedName::unquoted ('primary ' ), [
32- UnqualifiedName::unquoted ('id ' ),
33- UnqualifiedName::unquoted ('revision_id ' ),
34- ],
35- FALSE ,
36- ));
30+ // @phpstan-ignore class.notFound
31+ $ primary = UnqualifiedName::unquoted ('primary ' );
32+ $ columns = [
33+ // @phpstan-ignore class.notFound
34+ UnqualifiedName::unquoted ('id ' ),
35+ // @phpstan-ignore class.notFound
36+ UnqualifiedName::unquoted ('revision_id ' ),
37+ ];
38+ // @phpstan-ignore method.notFound, class.notFound
39+ $ tree ->addPrimaryKeyConstraint (new PrimaryKeyConstraint ($ primary , $ columns , FALSE ));
3740 }
3841 else {
3942 // doctrine/dbal 3.
40- // @phpstan-ignore-next-line
43+ // @phpstan-ignore method.deprecated
4144 $ tree ->setPrimaryKey (['id ' , 'revision_id ' ]);
4245 }
4346 $ tree ->addIndex (['revision_id ' ]);
0 commit comments