Commit 6b049a0
committed
BUGFIX: Respect type declaration when building class-schema
Without this change, any class property is ignored, if it has no `@var`
tag. As soon as a property lacks that tag, the early return in method
`evaluateClassPropertyAnnotationsForSchema` kicks in.
When using type declarations, this is nonsense, though. This change
thus makes sure the type is fetched from the native type declaration
if no `@var` tag is found. If a `@var` tag exists, it takes precedence.
This allows to do things like this to declare typed collections:
```php
/**
* @var Collection<AnnotatedIdentitiesEntity>
*/
#[ORM\ManyToMany(indexBy: 'author')]
protected Collection $annotatedIdentitiesEntities;
```1 parent 017f30f commit 6b049a0
1 file changed
+8
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1568 | 1568 | | |
1569 | 1569 | | |
1570 | 1570 | | |
1571 | | - | |
1572 | | - | |
1573 | | - | |
1574 | | - | |
1575 | 1571 | | |
1576 | 1572 | | |
1577 | 1573 | | |
1578 | 1574 | | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
1579 | 1580 | | |
1580 | | - | |
| 1581 | + | |
| 1582 | + | |
| 1583 | + | |
1581 | 1584 | | |
1582 | 1585 | | |
1583 | 1586 | | |
| |||
0 commit comments