← Open issues in Doctrine Helper
docs: Doctrine section with Doctrine Behaviors and Doctrine Helper (uk + en)
en/docs/doctrine/doctrine-helper/known_issues/open.md
new file +13
−0
Open issues in Doctrine Helper
Known bugs and inconsistencies of the current version of ufo-tech/doctrine-helper (1.1.0). Fixed ones are on the Fixed issues page.
<include>(.issues/autoincrement-interface-mismatch.md)
<include>(.issues/enum-null-value.md)
<include>(.issues/readme-errors.md)
en/docs/doctrine/doctrine-helper/known_issues/.issues/autoincrement-interface-mismatch.md
new file +29
−0
AutoIncrementIdTrait is incompatible with IHaveAutoincrementId
Affected versions: 1.0.0 — 1.1.0 (current). Verified by running on PHP 8.4.
Symptom. A class that implements IHaveAutoincrementId and uses AutoIncrementIdTrait does not load:
Fatal error: Declaration of App\Entity\Customer::getId(): ?int must be compatible with
Ufo\DoctrineHelper\Interfaces\IHaveAutoincrementId::getId(): int
Cause. AutoIncrementIdTrait::getId() returns ?int (there is no identifier before flush()), while the interface requires int.
Workaround. Do not implement the interface, or override the method in the class — a class method takes precedence over a trait method:
#[ORM\Entity]
class Customer implements IHaveAutoincrementId
{
use AutoIncrementIdTrait;
public function getId(): int
{
return $this->id ?? throw new \LogicException('Customer is not persisted yet.');
}
}
en/docs/doctrine/doctrine-helper/known_issues/.issues/enum-null-value.md
new file +11
−0
AbstractEnumType does not accept null
Affected versions: 1.0.0 — 1.1.0 (current). Verified by running on PHP 8.4 with DBAL 3.10; DBAL 4 passes null to the type in the same way.
Symptom. Writing null to a column with an AbstractEnumType-based type, even with nullable: true, fails with InvalidArgumentException: Invalid 'App\MyEnum' value. (on PHP 8.1+ preceded by the deprecation Passing null to parameter #1 ($value)).
Cause. DBAL calls convertToDatabaseValue() for null too, and the method passes the value to $enum::from() without a check; any error is turned into InvalidArgumentException. The string|int return type does not allow fixing this by overriding the method in a subclass.
Workaround. For nullable fields use Doctrine ORM's built-in enum mapping instead of this type — #[ORM\Column(type: 'string', enumType: MyEnum::class, nullable: true)] (the column is then VARCHAR, not ENUM) — or a dedicated enum case for a missing value.
en/docs/doctrine/doctrine-helper/known_issues/.issues/readme-errors.md
new file +12
−0
Errors in the package README
Affected versions: 1.0.0 — 1.1.0 (current). Verified against README.md and composer.json of tag 1.1.0.
- In the entity example
changeCase()writes to the non-existent$this->typeproperty instead of$this->case. - The
MyEnumTypeexample lacksuse Ufo\DoctrineHelper\DBAL\AbstractEnumType;. - The README describes only
AbstractEnumType; the traits, interfaces andUuidare not mentioned. - The
homepagelink incomposer.jsonand "Documentations" in the README point todocs.ufo-tech.space, not to this site.
Correct examples are on the PHP enum as ENUM and Entity identifiers pages.