Skip to content

Commit

Permalink
refactor: Adjustment due to the immutable times and authentication check
Browse files Browse the repository at this point in the history
  • Loading branch information
BibaltiK committed Jul 3, 2024
1 parent 18ed462 commit 2a0a3f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/App/Service/User/UserServiceFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
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 @@ -22,8 +21,8 @@ public function __invoke(ContainerInterface $container): UserService
/** @var ReflectionHydrator $hydrator */
$hydrator = clone $container->get(ReflectionHydrator::class);

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

/** @var Uuid $uuid */
$uuid = $container->get(Uuid::class);
Expand Down
3 changes: 1 addition & 2 deletions tests/Unit/App/Service/UserServiceFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
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 @@ -21,7 +20,7 @@ public function testCanCreateUserService(): void
UserRepository::class => new MockUserTable(),
ReflectionHydrator::class => $this->hydrator,
NullableStrategy::class => $this->nullableStrategy,
DateTimeImmutableFormatterStrategy::class => $this->dateTimeFormatterStrategy,
DateTimeFormatterStrategy::class => $this->dateTimeFormatterStrategy,
Uuid::class => Uuid::uuid4(),
]);

Expand Down

0 comments on commit 2a0a3f8

Please sign in to comment.