Avoiding an error warning in UserFactory.

This commit is contained in:
Alexey Skobkin 2023-04-01 19:40:23 +03:00
parent 8614bd0f26
commit f4e92a8f31
No known key found for this signature in database
GPG key ID: 5D5CEF6F221278E7

View file

@ -31,7 +31,7 @@ class UserFactory extends AbstractFactory
/** @var User $user */
if (null === ($user = $this->userRepository->find($userData->getId()))) {
$user = new User(
$userData->getId(),
(int) $userData->getId(),
\DateTime::createFromFormat('Y-m-d_H:i:s', $userData->getCreated()) ?: new \DateTime()
);
$this->userRepository->add($user);