Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

PasswordInfo.php
Go to the documentation of this file.
1 <?php
2
7 declare(strict_types=1);
8
9 namespace eZ\Publish\API\Repository\Values\User;
10
11 use DateTime;
12 use DateTimeImmutable;
13 use eZ\Publish\API\Repository\Values\ValueObject;
14
15 final class PasswordInfo extends ValueObject
16 {
18 private $expirationDate;
19
21 private $expirationWarningDate;
22
23 public function __construct(?DateTimeImmutable $expirationDate = null, ?DateTimeImmutable $expirationWarningDate = null)
24 {
25 $this->expirationDate = $expirationDate;
26 $this->expirationWarningDate = $expirationWarningDate;
27 }
28
29 public function isPasswordExpired(): bool
30 {
31 if ($this->expirationDate === null) {
32 return false;
33 }
34
35 return $this->expirationDate < new DateTime();
36 }
37
38 public function hasExpirationDate(): bool
39 {
40 return $this->expirationDate !== null;
41 }
42
43 public function getExpirationDate(): ?DateTimeImmutable
44 {
45 return $this->expirationDate;
46 }
47
48 public function hasExpirationWarningDate(): bool
49 {
50 return $this->expirationWarningDate !== null;
51 }
52
53 public function getExpirationWarningDate(): ?DateTimeImmutable
54 {
55 return $this->expirationWarningDate;
56 }
57 }
eZ\Publish\API\Repository\Values\User\PasswordInfo
Definition: PasswordInfo.php:16
eZ\Publish\API\Repository\Values\User\PasswordInfo\getExpirationWarningDate
getExpirationWarningDate()
Definition: PasswordInfo.php:53
eZ\Publish\API\Repository\Values\User\PasswordInfo\$expirationWarningDate
$expirationWarningDate
Definition: PasswordInfo.php:21
eZ\Publish\API\Repository\Values\User\PasswordInfo\__construct
__construct(?DateTimeImmutable $expirationDate=null, ?DateTimeImmutable $expirationWarningDate=null)
Definition: PasswordInfo.php:23
eZ\Publish\API\Repository\Values\User\PasswordInfo\isPasswordExpired
isPasswordExpired()
Definition: PasswordInfo.php:29
eZ\Publish\API\Repository\Values\User\PasswordInfo\hasExpirationWarningDate
hasExpirationWarningDate()
Definition: PasswordInfo.php:48
eZ\Publish\API\Repository\Values\User\PasswordInfo\hasExpirationDate
hasExpirationDate()
Definition: PasswordInfo.php:38
eZ\Publish\API\Repository\Values\User\PasswordInfo\$expirationDate
$expirationDate
Definition: PasswordInfo.php:18
eZ\Publish\API\Repository\Values\User\PasswordInfo\getExpirationDate
getExpirationDate()
Definition: PasswordInfo.php:43
eZ\Publish\API\Repository\Values\ValueObject
Definition: API/Repository/Values/ValueObject.php:21
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.