Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant abstractions #243

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 0 additions & 4 deletions config/chat/services/chat.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
services:
chat.chat-controller:
class: Gaming\Chat\Presentation\Http\ChatController
arguments: ['@chat.command-bus', '@chat.query-bus']

chat.chat-gateway:
class: Gaming\Chat\Infrastructure\DoctrineChatGateway
arguments: ['@chat.doctrine-dbal', 'chat', 'message']
Expand Down
4 changes: 0 additions & 4 deletions config/connect-four/services/game.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
services:
connect-four.game-controller:
class: Gaming\ConnectFour\Port\Adapter\Http\GameController
arguments: ['@connect-four.command-bus', '@connect-four.query-bus']

connect-four.game-repository:
class: Gaming\ConnectFour\Port\Adapter\Persistence\Repository\DoctrineJsonGameRepository
arguments:
Expand Down
4 changes: 0 additions & 4 deletions config/identity/services/user.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
services:
identity.user-controller:
class: Gaming\Identity\Port\Adapter\Http\UserController
arguments: ['@identity.command-bus']

identity.user-repository:
class: Gaming\Identity\Port\Adapter\Persistence\Repository\DoctrineUserRepository
arguments: ['@identity.doctrine-orm']
Expand Down
2 changes: 1 addition & 1 deletion config/web-interface/services/console.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
Gaming\WebInterface\Presentation\Console\PublishRunningGamesCountToNchanCommand:
arguments: ['@web-interface.connect-four-service', '@web-interface.browser-notifier']
arguments: ['@connect-four.query-bus', '@web-interface.browser-notifier']
tags:
- name: console.command
command: web-interface:publish-running-games-count-to-nchan
Expand Down
8 changes: 4 additions & 4 deletions config/web-interface/services/controller.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
services:
web-interface.page-controller:
class: Gaming\WebInterface\Presentation\Http\PageController
arguments: ['@twig', '@web-interface.connect-four-service', '@web-interface.security']
arguments: ['@twig', '@connect-four.query-bus', '@web-interface.security']
tags: ['controller.service_arguments']

web-interface.signup-controller:
class: Gaming\WebInterface\Presentation\Http\SignupController
arguments:
- '@uri_signer'
- '@web-interface.security'
- '@web-interface.identity-service'
- '@identity.command-bus'
- '@gaming.form-violation-mapper'
calls: [[setContainer, ['@Psr\Container\ContainerInterface']]]
tags: ['controller.service_arguments', 'container.service_subscriber']
Expand All @@ -28,10 +28,10 @@ services:

web-interface.chat-controller:
class: Gaming\WebInterface\Presentation\Http\ChatController
arguments: ['@web-interface.chat-service', '@web-interface.security']
arguments: ['@chat.command-bus', '@chat.query-bus', '@web-interface.security']
tags: ['controller.service_arguments']

web-interface.connect-four-controller:
class: Gaming\WebInterface\Presentation\Http\ConnectFourController
arguments: ['@web-interface.connect-four-service', '@web-interface.security']
arguments: ['@connect-four.command-bus', '@web-interface.security']
tags: ['controller.service_arguments']
12 changes: 0 additions & 12 deletions config/web-interface/services/integration.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
services:
web-interface.chat-service:
class: Gaming\WebInterface\Infrastructure\Integration\DirectControllerInvocationChatService
arguments: ['@chat.chat-controller']

web-interface.connect-four-service:
class: Gaming\WebInterface\Infrastructure\Integration\DirectControllerInvocationConnectFourService
arguments: ['@connect-four.game-controller']

web-interface.identity-service:
class: Gaming\WebInterface\Infrastructure\Integration\DirectControllerInvocationIdentityService
arguments: ['@identity.user-controller']

web-interface.nchan:
class: Marein\Nchan\Nchan
arguments:
Expand Down
2 changes: 1 addition & 1 deletion config/web-interface/services/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ services:

web-interface.security.arrival_authenticator:
class: Gaming\WebInterface\Infrastructure\Security\ArrivalAuthenticator
arguments: ['@web-interface.identity-service', '@security.token_storage']
arguments: ['@identity.command-bus', '@security.token_storage']
59 changes: 0 additions & 59 deletions src/Chat/Presentation/Http/ChatController.php

This file was deleted.

5 changes: 5 additions & 0 deletions src/ConnectFour/Application/Game/Query/Model/Game/Game.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ public function id(): string
return $this->gameId;
}

public function chatId(): string
{
return $this->chatId;
}

public function finished(): bool
{
return $this->finished;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,9 @@

final class OpenGame
{
private string $gameId;

private string $playerId;

public function __construct(string $gameId, string $playerId)
{
$this->gameId = $gameId;
$this->playerId = $playerId;
}

public function gameId(): string
{
return $this->gameId;
}

public function playerId(): string
{
return $this->playerId;
public function __construct(
public readonly string $gameId,
public readonly string $playerId
) {
}
}
178 changes: 0 additions & 178 deletions src/ConnectFour/Port/Adapter/Http/GameController.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ public function __construct(
public function save(OpenGame $openGame): void
{
$this->predis->pipeline(function (ClientContextInterface $pipeline) use ($openGame): void {
$pipeline->set($this->storageKeyForGameInfo($openGame->gameId()), $openGame->playerId());
$pipeline->set($this->storageKeyForGameInfo($openGame->gameId), $openGame->playerId);

$pipeline->zadd(
$this->storageKey,
[$openGame->gameId() => microtime(true)]
[$openGame->gameId => microtime(true)]
);
});
}
Expand Down
Loading
Loading