Timestampable error if #[Assert\EnableAutoMapping]
With automapping on, I'm getting validation errors for anything using the Timestampable trait
#[Assert\EnableAutoMapping]
class MyEntity {
use Timestampable;

Both values are indeed set.
It has something to do with PHP8 and requiring that the entity be valid if there are types, including the annotations
/**
* @var \DateTime
*/
protected $createdAt;
/**
* @var \DateTime
*/
protected $updatedAt;
I'm not sure what the solution is. It could be
/**
* @var ?\DateTime
*/
protected $createdAt=null;
/**
* @var ?\DateTime
*/
protected $updatedAt=null;
so that the entity would be valid before it is persisted.
Not sure if we can do something from the package because the extension sets these variables when persisting/updating.
so that the entity would be valid before it is persisted.
This is the main problem, entities should always be in a valid state, in this case when using Timestampable I usually also set those properties in the constructor.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.