Should be cloned also in the getter in fact
On 14 Jun 2013 15:16, "Ben Scholzen" <notifications@github.com> wrote:

> In src/BaconUser/Entity/ResetPassword.php:
>
> > +
> > +    /**
> > +     * @return DateTime
> > +     */
> > +    public function getExpirationDate()
> > +    {
> > +        return $this->expirationDate;
> > +    }
> > +
> > +    /**
> > +     * @param  DateTime $expirationDate
> > +     * @return ResetPassword
> > +     */
> > +    public function setExpirationDate(DateTime $expirationDate)
> > +    {
> > +        $this->expirationDate = clone $expirationDate;
>
> Not a solution. When one does ->getExpirationDate()->modify()… you'll end
> up with the same problem.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/Bacon/BaconUser/pull/16/files#r4700690>
> .
>