KnpLabs / DoctrineBehaviors

Doctrine2 behavior traits that help handling Blameable, Loggable, Sluggable, SoftDeletable, Uuidable, Timestampable, Translatable, Tree behavior
http://knplabs.com
MIT License
914 stars 294 forks source link

Allow getCreatedAt and getUpdatedAt to return null #637

Closed grizzlylab closed 3 years ago

grizzlylab commented 3 years ago

To fix this issue : https://github.com/KnpLabs/DoctrineBehaviors/issues/558

grizzlylab commented 3 years ago

@TomasVotruba Hi this PR intends to resolve the issue (https://github.com/KnpLabs/DoctrineBehaviors/issues/558) when we create an Entity being validated by the validator service of Symfony. Our object/entity has still no date, so we get the error "get null instead DateTimeInterface".

You will notice that I had a strange behavior when executing "composer fix-cs" as recommended in your 3 steps contribution section (README.md) : all classes where prefixed with final which leads to break this bundle. The only thing I found to make the pipeline pass is to disable the FinalClassFixer which is probably not a good thing.

Can you help me for this ?

TomasVotruba commented 3 years ago

Hi, thanks for the PR! Looks good :+1:

The only thing I found to make the pipeline pass is to disable the FinalClassFixer which is probably not a good thing.

This rule is now deprecated, so it can be removed from ecs.php We handle this use case by Rector in better way.

grizzlylab commented 3 years ago

@TomasVotruba I removed the parameter from ecs.php. Is it ok to be merged ? Do you prefer one or two commits ?

TomasVotruba commented 3 years ago

Looks good to me, thank you 😊

micronax commented 3 years ago

Time for a new release? :)