Open ThomasLandauer opened 2 years ago
I have the same problem
Same problem here on doctrine/orm 2.14.1
It also applies to other types:
/**
* @var ViewSettingsEnum[]
*/
#[ORM\Column(type: 'json', nullable: true, enumType: ViewSettingsEnum::class)]
private ?array $viewSettings = null;
results in
------ -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Line src/Entity/Employee.php
------ -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
96 Property App\Entity\Employee::$viewSettings type mapping mismatch: backing type string of enum App\Enum\ViewSettingsEnum does not match database type array|bool|float|int|JsonSerializable|stdClass|string|null.
96 Property App\Entity\Employee::$viewSettings type mapping mismatch: database can contain App\Enum\ViewSettingsEnum|null but property expects array<App\Enum\ViewSettingsEnum>|null.
96 Property App\Entity\Employee::$viewSettings type mapping mismatch: property can contain array<App\Enum\ViewSettingsEnum>|null but database expects App\Enum\ViewSettingsEnum|null.
------ -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Still present with doctrine/orm 3.1.3
Still present on doctrine/orm 3.2.0
Still present...
"doctrine/orm": "3.2.1",
"phpstan/phpstan": "1.11.17",
"phpstan/phpstan-doctrine": "1.4.5",
doctrine/orm
2.12.0 now supports arrays of enums, see https://github.com/doctrine/orm/pull/9497This is the syntax:
phpstan is reporting: