Skip to content

Commit

Permalink
Change option name from bus to class
Browse files Browse the repository at this point in the history
This should help prevent confusion with named command buses like in the
old symfony bundle, as well as add better cohesion with the new method
option.
  • Loading branch information
rosstuck committed Sep 18, 2019
1 parent cb356e8 commit ebd6707
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Instead, you can configure the command bus class to scan for, as well as (option
parameters:
tactician:
bootstrap: handler-mapping-loader.php
bus: My\App\CommandBus
class: My\App\CommandBus
method: execute
~~~

Expand Down
6 changes: 3 additions & 3 deletions extension.neon
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
parameters:
tactician:
bus: League\Tactician\CommandBus
class: League\Tactician\CommandBus
method: handle

services:
-
class: League\Tactician\PHPStan\TacticianRuleSet
arguments:
commandBusClass: %tactician.bus%
commandBusClass: %tactician.class%
commandBusMethod: %tactician.method%
tags:
- phpstan.rules.rule

-
class: League\Tactician\PHPStan\HandlerReturnTypeExtension
arguments:
commandBusClass: %tactician.bus%
commandBusClass: %tactician.class%
commandBusMethod: %tactician.method%
tags:
- phpstan.broker.dynamicMethodReturnTypeExtension
Expand Down
8 changes: 6 additions & 2 deletions src/TacticianRuleSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ final class TacticianRuleSet implements Rule
*/
private $commandBusMethod;

public function __construct(CommandToHandlerMapping $mapping, Broker $broker, string $commandBusClass, string $commandBusMethod)
{
public function __construct(
CommandToHandlerMapping $mapping,
Broker $broker,
string $commandBusClass,
string $commandBusMethod
) {
$this->mapping = $mapping;
$this->broker = $broker;
$this->commandBusClass = $commandBusClass;
Expand Down
2 changes: 1 addition & 1 deletion tests/phpstan-alternate-class.neon
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ includes:
parameters:
tactician:
bootstrap: tests/handler-mapping-loader.php
bus: MissingHandlerClassForAlternateBus\DerpBus
class: MissingHandlerClassForAlternateBus\DerpBus
method: execute

0 comments on commit ebd6707

Please sign in to comment.