Code Duplication    Length = 8-8 lines in 2 locations

src/User/UserEntityTrait.php 2 locations

@@ 139-146 (lines=8) @@
136
        return $this;
137
    }
138
139
    public function canGenerateNewEmailConfirmationToken(): boolean
140
    {
141
        $lastGenerated = $this->getLastEmailTokenGeneratedDatetime();
142
        return (
143
            empty($lastGenerated) ||
144
            (new DateTime())->getTimestamp() - $lastGenerated->getTimestamp() > UserEntityInterface::EMAIL_COOLDOWN
145
        );
146
    }
147
148
    public function generateEmailConfirmationToken(): UserEntityInterface
149
    {
@@ 215-222 (lines=8) @@
212
        return $this;
213
    }
214
215
    public function canGenerateNewResetPasswordToken(): boolean
216
    {
217
        $lastGenerated = $this->getLastPasswordResetTokenGeneratedDatetime();
218
        return (
219
            empty($lastGenerated) ||
220
            (new DateTime())->getTimestamp() - $lastGenerated->getTimestamp() > UserEntityInterface::EMAIL_COOLDOWN
221
        );
222
    }
223
224
    public function generatePasswordResetToken(): UserEntityInterface
225
    {