Skip to content

Commit e3c5d08

Browse files
committed
Added missing type aliases in ClassMetadata stub
1 parent f1499e5 commit e3c5d08

File tree

2 files changed

+93
-78
lines changed

2 files changed

+93
-78
lines changed

stubs/ORM/Mapping/ClassMetadata.stub

+88
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,94 @@ namespace Doctrine\ORM\Mapping;
55
/**
66
* @template-covariant T of object
77
* @extends ClassMetadataInfo<T>
8+
* @phpstan-type FieldMapping = array{
9+
* type: string,
10+
* fieldName: string,
11+
* columnName: string,
12+
* length?: int,
13+
* id?: bool,
14+
* nullable?: bool,
15+
* notInsertable?: bool,
16+
* notUpdatable?: bool,
17+
* generated?: int,
18+
* enumType?: class-string<\BackedEnum>,
19+
* columnDefinition?: string,
20+
* precision?: int,
21+
* scale?: int,
22+
* unique?: bool,
23+
* inherited?: class-string,
24+
* originalClass?: class-string,
25+
* originalField?: string,
26+
* quoted?: bool,
27+
* requireSQLConversion?: bool,
28+
* declared?: class-string,
29+
* declaredField?: string,
30+
* options?: array<string, mixed>,
31+
* version?: string,
32+
* default?: string|int,
33+
* }
34+
* @phpstan-type JoinColumnData = array{
35+
* name: string,
36+
* referencedColumnName: string,
37+
* unique?: bool,
38+
* quoted?: bool,
39+
* fieldName?: string,
40+
* onDelete?: string,
41+
* columnDefinition?: string,
42+
* nullable?: bool,
43+
* }
44+
* @phpstan-type AssociationMapping = array{
45+
* cache?: array,
46+
* cascade: array<string>,
47+
* declared?: class-string,
48+
* fetch: mixed,
49+
* fieldName: string,
50+
* id?: bool,
51+
* inherited?: class-string,
52+
* indexBy?: string,
53+
* inversedBy: string|null,
54+
* isCascadeRemove: bool,
55+
* isCascadePersist: bool,
56+
* isCascadeRefresh: bool,
57+
* isCascadeMerge: bool,
58+
* isCascadeDetach: bool,
59+
* isOnDeleteCascade?: bool,
60+
* isOwningSide: bool,
61+
* joinColumns?: array<JoinColumnData>,
62+
* joinColumnFieldNames?: array<string, string>,
63+
* joinTable?: array,
64+
* joinTableColumns?: list<mixed>,
65+
* mappedBy: string|null,
66+
* orderBy?: array,
67+
* originalClass?: class-string,
68+
* originalField?: string,
69+
* orphanRemoval?: bool,
70+
* relationToSourceKeyColumns?: array,
71+
* relationToTargetKeyColumns?: array,
72+
* sourceEntity: class-string,
73+
* sourceToTargetKeyColumns?: array<string, string>,
74+
* targetEntity: class-string,
75+
* targetToSourceKeyColumns?: array<string, string>,
76+
* type: int,
77+
* unique?: bool,
78+
* }
79+
* @phpstan-type DiscriminatorColumnMapping = array{
80+
* name: string,
81+
* fieldName: string,
82+
* type: string,
83+
* length?: int,
84+
* columnDefinition?: string|null,
85+
* enumType?: class-string<\BackedEnum>|null,
86+
* options?: array<string, mixed>,
87+
* }
88+
* @phpstan-type EmbeddedClassMapping = array{
89+
* class: class-string,
90+
* columnPrefix: string|null,
91+
* declaredField: string|null,
92+
* originalField: string|null,
93+
* inherited?: class-string,
94+
* declared?: class-string,
95+
* }
896
*/
997
class ClassMetadata extends ClassMetadataInfo
1098
{

stubs/ORM/Mapping/ClassMetadataInfo.stub

+5-78
Original file line numberDiff line numberDiff line change
@@ -2,91 +2,18 @@
22

33
namespace Doctrine\ORM\Mapping;
44

5-
use BackedEnum;
65
use Doctrine\ORM\Id\AbstractIdGenerator;
76
use Doctrine\Persistence\Mapping\ClassMetadata;
87
use ReflectionClass;
98

109
/**
1110
* @template-covariant T of object
1211
* @template-implements ClassMetadata<T>
13-
* @psalm-type FieldMapping = array{
14-
* type: string,
15-
* fieldName: string,
16-
* columnName: string,
17-
* length?: int,
18-
* id?: bool,
19-
* nullable?: bool,
20-
* notInsertable?: bool,
21-
* notUpdatable?: bool,
22-
* generated?: int,
23-
* enumType?: class-string<BackedEnum>,
24-
* columnDefinition?: string,
25-
* precision?: int,
26-
* scale?: int,
27-
* unique?: string,
28-
* inherited?: class-string,
29-
* originalClass?: class-string,
30-
* originalField?: string,
31-
* quoted?: bool,
32-
* requireSQLConversion?: bool,
33-
* declared?: class-string,
34-
* declaredField?: string,
35-
* options?: array<string, mixed>
36-
* }
37-
* @psalm-type JoinColumnData = array{
38-
* name: string,
39-
* referencedColumnName: string,
40-
* unique?: bool,
41-
* quoted?: bool,
42-
* fieldName?: string,
43-
* onDelete?: string,
44-
* columnDefinition?: string,
45-
* nullable?: bool,
46-
* }
47-
* @psalm-type AssociationMapping = array{
48-
* cache?: array,
49-
* cascade: array<string>,
50-
* declared?: class-string,
51-
* fetch: mixed,
52-
* fieldName: string,
53-
* id?: bool,
54-
* inherited?: class-string,
55-
* indexBy?: string,
56-
* inversedBy: string|null,
57-
* isCascadeRemove: bool,
58-
* isCascadePersist: bool,
59-
* isCascadeRefresh: bool,
60-
* isCascadeMerge: bool,
61-
* isCascadeDetach: bool,
62-
* isOnDeleteCascade?: bool,
63-
* isOwningSide: bool,
64-
* joinColumns?: array<JoinColumnData>,
65-
* joinColumnFieldNames?: array<string, string>,
66-
* joinTable?: array,
67-
* joinTableColumns?: list<mixed>,
68-
* mappedBy: string|null,
69-
* orderBy?: array,
70-
* originalClass?: class-string,
71-
* originalField?: string,
72-
* orphanRemoval?: bool,
73-
* relationToSourceKeyColumns?: array,
74-
* relationToTargetKeyColumns?: array,
75-
* sourceEntity: class-string,
76-
* sourceToTargetKeyColumns?: array<string, string>,
77-
* targetEntity: class-string,
78-
* targetToSourceKeyColumns?: array<string, string>,
79-
* type: int,
80-
* unique?: bool,
81-
* }
82-
* @psalm-type DiscriminatorColumnMapping = array{
83-
* name: string,
84-
* fieldName: string,
85-
* type: string,
86-
* length?: int,
87-
* columnDefinition?: string|null,
88-
* enumType?: class-string<BackedEnum>|null,
89-
* }
12+
* @phpstan-import-type AssociationMapping from \Doctrine\ORM\Mapping\ClassMetadata
13+
* @phpstan-import-type FieldMapping from \Doctrine\ORM\Mapping\ClassMetadata
14+
* @phpstan-import-type EmbeddedClassMapping from \Doctrine\ORM\Mapping\ClassMetadata
15+
* @phpstan-import-type JoinColumnData from \Doctrine\ORM\Mapping\ClassMetadata
16+
* @phpstan-import-type DiscriminatorColumnMapping from \Doctrine\ORM\Mapping\ClassMetadata
9017
*/
9118
class ClassMetadataInfo implements ClassMetadata
9219
{

0 commit comments

Comments
 (0)