Skip to content

Commit

Permalink
style: apply new php cs fixer rules
Browse files Browse the repository at this point in the history
  • Loading branch information
rgomezcasas committed Sep 27, 2023
1 parent 751c0bc commit a99da61
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use CodelyTv\Mooc\CoursesCounter\Application\Find\CoursesCounterResponse;
use CodelyTv\Mooc\CoursesCounter\Application\Find\FindCoursesCounterQuery;
use CodelyTv\Shared\Domain\ValueObject\Uuid;
use CodelyTv\Shared\Domain\ValueObject\SimpleUuid;
use CodelyTv\Shared\Infrastructure\Symfony\WebController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
Expand All @@ -24,7 +24,7 @@ public function __invoke(Request $request): Response
'title' => 'Courses',
'description' => 'Courses CodelyTV - Backoffice',
'courses_counter' => $coursesCounterResponse->total(),
'new_course_id' => Uuid::random()->value(),
'new_course_id' => SimpleUuid::random()->value(),
]
);
}
Expand Down
2 changes: 1 addition & 1 deletion apps/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
);
} else {
// load all the .env files
(new Dotenv(false))->loadEnv($rootPath . '/.env');
(new Dotenv())->loadEnv($rootPath . '/.env');
}

$_SERVER += $_ENV;
Expand Down
6 changes: 6 additions & 0 deletions ecs.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,10 @@
$ecsConfig->ruleWithConfiguration(YodaStyleFixer::class, ['equal' => false, 'identical' => false, 'less_and_greater' => false]);
$ecsConfig->ruleWithConfiguration(PhpUnitMethodCasingFixer::class, ['case' => PhpUnitMethodCasingFixer::SNAKE_CASE]);
$ecsConfig->ruleWithConfiguration(OrderedTypesFixer::class, ['null_adjustment' => 'always_last']);

$ecsConfig->skip([
FinalClassFixer::class => [
__DIR__ . '/src/Shared/Infrastructure/Bus/Event/InMemory/InMemorySymfonyEventBus.php',
]
]);
};
3 changes: 2 additions & 1 deletion src/Shared/Domain/Bus/Event/DomainEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace CodelyTv\Shared\Domain\Bus\Event;

use CodelyTv\Shared\Domain\Utils;
use CodelyTv\Shared\Domain\ValueObject\SimpleUuid;
use CodelyTv\Shared\Domain\ValueObject\Uuid;
use DateTimeImmutable;

Expand All @@ -15,7 +16,7 @@ abstract class DomainEvent

public function __construct(private readonly string $aggregateId, string $eventId = null, string $occurredOn = null)
{
$this->eventId = $eventId ?: Uuid::random()->value();
$this->eventId = $eventId ?: SimpleUuid::random()->value();
$this->occurredOn = $occurredOn ?: Utils::dateToString(new DateTimeImmutable());
}

Expand Down
7 changes: 7 additions & 0 deletions src/Shared/Domain/ValueObject/SimpleUuid.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace CodelyTv\Shared\Domain\ValueObject;

final class SimpleUuid extends Uuid
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use Symfony\Component\Messenger\MessageBus;
use Symfony\Component\Messenger\Middleware\HandleMessageMiddleware;

final class InMemorySymfonyEventBus implements EventBus
class InMemorySymfonyEventBus implements EventBus
{
private readonly MessageBus $bus;

Expand Down

0 comments on commit a99da61

Please sign in to comment.