This commit changes LastSubscribedAtListener to pass a copy of the Carbon
object representing the current time to the SubscriberEntity property
lastSubscribedAt. Passing a copy instead of the object itself is needed to
avoid unexpected side effects. Before this change, modifying the time
of this property of a given SubscriberEntity instance could affect the
same field of another instance as the same object used inside
LastSubscribedAtListener for all entities.
[MAILPOET-3946]
This commit changes TimestampListener to pass a copy of the Carbon
object representing the current time to the entity properties updatedAt
and createdAt. Passing a copy instead of the object itself is needed to
avoid unexpected side effects. Before this change, modifying the time
of the createdAt or updatedAt field of a given entity could affect the
same field of another entity as it could be the same object used inside
TimestampListener for all entities.
[MAILPOET-3870]
This commit changes the code of the method
\MailPoet\Newsletter\Links\Links::save() to use Doctrine references
instead of full entities when getting a newsletter and sending queue
entities to save the related links.
We don't need the full entities here, and getting a full entity for the
sending queue was generating an error in the
testItLogsErrorWhenNewlyRenderedNewsletterBodyIsInvalid() integration
test (see the description of PR
https://github.com/mailpoet/mailpoet/pull/3784 for more details).
To be able to get the reference, it was necessary to add a helper method
called getReference() to \MailPoet\Doctrine\Repository.
[MAILPOET-3816]
NewsletterTemplateEntity carries base64 data of image. This commit changes how we load templates entities when we process thumbnail images so that there is only one template in memory.
[MAILPOET-2686]
The annotation reader was using CachedReader which has been deprecated so we need to switch to PsrCachedReader
Since 2.0 doctrine/cache no longer provides implementations of caches so I also needed to implement a simple PSR array cache.
[MAILPOET-3892]
doctrine/cache 2.0 no longer provides implementations of caches. It provides only interfaces.
We need only PHP array cache so I chose to implement this simple cache instead of introducing
new cache library.
[MAILPOET-3892]
This commit removes the checkGenericClassInNonGenericObjectType flag
from PHPStan configuration files and fixes all associated errors in our
code base.
[MAILPOET-3236]
Doctrine uses a default ProxyClassNameResolver but it is implemented
as an anonymous class and can not be serialised. This commit adds a custom
ProxyClassNameResolver that copies the anonymous one so that we avoid using the
anonymous fallback.
[MAILPOET-3658]