You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description Metadata/ApiProperty.php default property has incorrect PHP annotation type. No actual type is set, but the annotation says it is null | string. It is also different from the example type.
Annotation:
This is of course a very low priority issue. It is only an inconvenience when having an integer property and psalm complains the default value is not the correct type, so we have to add the @psalm-suppress InvalidArgument annotation to the property.
How to reproduce
Have an entity with attributes like this
API Platform version(s) affected: 3.0 and up
Description
Metadata/ApiProperty.php
default property has incorrect PHP annotation type. No actual type is set, but the annotation says it isnull | string
. It is also different from the example type.Annotation:
core/src/Metadata/ApiProperty.php
Lines 31 to 32 in 2e92aea
Actual type:
core/src/Metadata/ApiProperty.php
Lines 54 to 55 in 2e92aea
This is of course a very low priority issue. It is only an inconvenience when having an integer property and psalm complains the default value is not the correct type, so we have to add the
@psalm-suppress InvalidArgument
annotation to the property.How to reproduce
Have an entity with attributes like this
psalm xml files
psalm.xml
psalm-baseline.xml
Possible Solution
Remove the type annotation from the property
default
inMetadata/ApiProperty.php
or set it tomixed
like with example.Additional Context
Psalm error output:
The text was updated successfully, but these errors were encountered: