Skip to content
This repository has been archived by the owner on May 6, 2018. It is now read-only.

Commit

Permalink
Merge pull request #5 from lcobucci/improve/use-guessable-name
Browse files Browse the repository at this point in the history
Give a guessable name for tactician services
  • Loading branch information
lcobucci authored Jan 2, 2018
2 parents aecfde9 + a9f823a commit 7830ec6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
},
"require-dev": {
"league/tactician-container": "^2.0",
"phpstan/phpstan": "^0.8",
"phpstan/phpstan": "^0.9",
"phpstan/phpstan-phpunit": "^0.9",
"phpunit/phpunit": "^6.3",
"squizlabs/php_codesniffer": "^3.1",
"symfony/dependency-injection": "^3.3"
Expand Down
11 changes: 4 additions & 7 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
parameters:
ignoreErrors:
# Ignore PHPUnit mock stuff
- '#but returns PHPUnit_Framework_MockObject_MockObject#'
- '#PHPUnit_Framework_MockObject_MockObject.* given#'
includes:
- vendor/phpstan/phpstan-phpunit/extension.neon

# Ignore symfony/expression-language missing classes
- '#Symfony\\Component\\ExpressionLanguage\\ExpressionLanguage not found#'
parameters:
ignoreErrors: []
5 changes: 3 additions & 2 deletions src/DependencyInjection/RegisterServices.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ private function registerCommandBus(
array $middlewares
): void {
$internalBus = $this->registerTacticianBus(
$this->commandBusId . '.inner',
$container,
$commandNameExtractor,
$methodNameInflector,
Expand All @@ -259,6 +260,7 @@ private function registerQueryBus(
$middlewares[] = $this->registerReadModelConverter($container, $readModelConverter);

$internalBus = $this->registerTacticianBus(
$this->queryBusId . '.inner',
$container,
$commandNameExtractor,
$methodNameInflector,
Expand All @@ -285,14 +287,13 @@ private function registerReadModelConverter(ContainerBuilder $container, Referen
}

private function registerTacticianBus(
string $id,
ContainerBuilder $container,
Reference $commandNameExtractor,
Reference $methodNameInflector,
array $handlers,
array $middlewares
): Reference {
$id = uniqid('chimera.bus_internal.');

$handlerMiddleware = $this->registerTacticianHandler(
$container,
$id,
Expand Down
3 changes: 2 additions & 1 deletion tests/DependencyInjection/RegisterServicesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@

final class RegisterServicesTest extends \PHPUnit\Framework\TestCase
{
private const DEFAULT_MIDDLEWARES_PATTERN = '/^chimera\.(read_model_conversion|bus_internal)\..*(\.handler)?$/';
private const DEFAULT_MIDDLEWARES_PATTERN = '/^(chimera\.(read_model_conversion|bus_internal)\..*|'
. '.*\.inner\.handler)$/';

private const COMMAND_BUS = 'command_bus';
private const QUERY_BUS = 'query_bus';
Expand Down

0 comments on commit 7830ec6

Please sign in to comment.