Skip to content

Commit

Permalink
fix: immutable times
Browse files Browse the repository at this point in the history
  • Loading branch information
BibaltiK committed Jul 3, 2024
1 parent 2a0a3f8 commit c769343
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/App/Service/User/UserServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use App\Repository\UserRepository;
use App\System\Hydrator\Strategy\UuidStrategy;
use Laminas\Hydrator\Strategy\BackedEnumStrategy;
use Laminas\Hydrator\Strategy\DateTimeFormatterStrategy;
use Laminas\Hydrator\Strategy\DateTimeImmutableFormatterStrategy;
use Psr\Container\ContainerInterface;
use Ramsey\Uuid\Uuid;

Expand All @@ -21,8 +21,8 @@ public function __invoke(ContainerInterface $container): UserService
/** @var ReflectionHydrator $hydrator */
$hydrator = clone $container->get(ReflectionHydrator::class);

/** @var DateTimeFormatterStrategy $dateTimeFormatterStrategy */
$dateTimeFormatterStrategy = $container->get(DateTimeFormatterStrategy::class);
/** @var DateTimeImmutableFormatterStrategy $dateTimeFormatterStrategy */
$dateTimeFormatterStrategy = $container->get(DateTimeImmutableFormatterStrategy::class);

/** @var Uuid $uuid */
$uuid = $container->get(Uuid::class);
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/App/Service/UserServiceFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use App\Repository\UserRepository;
use App\Service\User\UserService;
use App\Service\User\UserServiceFactory;
use Laminas\Hydrator\Strategy\DateTimeFormatterStrategy;
use Laminas\Hydrator\Strategy\DateTimeImmutableFormatterStrategy;
use Laminas\Hydrator\Strategy\NullableStrategy;
use Ramsey\Uuid\Uuid;
use Test\Unit\Mock\MockContainer;
Expand All @@ -20,7 +20,7 @@ public function testCanCreateUserService(): void
UserRepository::class => new MockUserTable(),
ReflectionHydrator::class => $this->hydrator,
NullableStrategy::class => $this->nullableStrategy,
DateTimeFormatterStrategy::class => $this->dateTimeFormatterStrategy,
DateTimeImmutableFormatterStrategy::class => $this->dateTimeImmutableFormatterStrategy,
Uuid::class => Uuid::uuid4(),
]);

Expand Down

0 comments on commit c769343

Please sign in to comment.