Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Core/src/Admin/src/Entity/Admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ public function getIdentifier(): string
* lastName: string|null,
* status: non-empty-string,
* roles: iterable<RoleType>,
* created: DateTimeImmutable,
* created: DateTimeImmutable|null,
* updated: DateTimeImmutable|null,
* }
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/Admin/src/Entity/AdminLogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public function setLoginStatus(SuccessFailureEnum $loginStatus): self
* clientEngine: string|null,
* clientVersion: string|null,
* loginStatus: string,
* created: DateTimeImmutable,
* created: DateTimeImmutable|null,
* updated: DateTimeImmutable|null,
* }
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/App/src/Entity/EntityInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function getId(): UuidInterface;

public function getCreated(): ?DateTimeImmutable;

public function getCreatedFormatted(string $dateFormat = 'Y-m-d H:i:s'): string;
public function getCreatedFormatted(string $dateFormat = 'Y-m-d H:i:s'): ?string;

public function getUpdated(): ?DateTimeImmutable;

Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/App/src/Entity/RoleInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* @phpstan-type RoleType array{
* id: non-empty-string,
* name: non-empty-string,
* created: DateTimeImmutable,
* created: DateTimeImmutable|null,
* updated: DateTimeImmutable|null
* }
*/
Expand Down
12 changes: 4 additions & 8 deletions src/Core/src/App/src/Entity/TimestampsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
trait TimestampsTrait
{
#[ORM\Column(name: 'created', type: 'datetime_immutable')]
protected DateTimeImmutable $created;
protected ?DateTimeImmutable $created = null;

#[ORM\Column(name: 'updated', type: 'datetime_immutable', nullable: true)]
protected ?DateTimeImmutable $updated = null;
Expand All @@ -20,9 +20,9 @@ public function getCreated(): ?DateTimeImmutable
return $this->created;
}

public function getCreatedFormatted(string $dateFormat = 'Y-m-d H:i:s'): string
public function getCreatedFormatted(string $dateFormat = 'Y-m-d H:i:s'): ?string
{
return $this->created->format($dateFormat);
return $this->created?->format($dateFormat);
}

public function getUpdated(): ?DateTimeImmutable
Expand All @@ -32,11 +32,7 @@ public function getUpdated(): ?DateTimeImmutable

public function getUpdatedFormatted(string $dateFormat = 'Y-m-d H:i:s'): ?string
{
if ($this->updated instanceof DateTimeImmutable) {
return $this->updated->format($dateFormat);
}

return null;
return $this->updated?->format($dateFormat);
}

#[ORM\PrePersist]
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/User/src/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ public function hasRoles(): bool
* identity: non-empty-string|null,
* status: non-empty-string,
* roles: RoleType[],
* created: DateTimeImmutable,
* created: DateTimeImmutable|null,
* updated: DateTimeImmutable|null,
* }
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/User/src/Entity/UserAvatar.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @phpstan-type UserAvatarType array{
* id: non-empty-string,
* url: non-empty-string|null,
* created: DateTimeImmutable,
* created: DateTimeImmutable|null,
* updated: DateTimeImmutable|null
* }
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/User/src/Entity/UserDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* firstName: non-empty-string|null,
* lastName: non-empty-string|null,
* email: non-empty-string|null,
* created: DateTimeImmutable,
* created: DateTimeImmutable|null,
* updated: DateTimeImmutable|null,
* }
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Core/src/User/src/Entity/UserResetPassword.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ public function markAsCompleted(): self
* expires: DateTimeImmutable,
* hash: non-empty-string,
* status: 'completed'|'requested',
* created: DateTimeImmutable,
* created: DateTimeImmutable|null,
* updated: DateTimeImmutable|null
* }
*/
Expand Down