Skip to content

Commit

Permalink
use common exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangut committed Feb 3, 2019
1 parent 3720876 commit a59e611
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 67 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
- COMPOSER_FLAGS="--prefer-stable --prefer-dist"

php:
- 7.2
- 7.3
- nightly

matrix:
Expand All @@ -22,7 +22,7 @@ matrix:
- php: 7.1
env:
- COMPOSER_FLAGS="--prefer-lowest --prefer-stable --prefer-dist"
- php: 7.1
- php: 7.2
env:
- TEST_VERSION=true
- COMPOSER_FLAGS="--prefer-stable --prefer-dist"
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,22 @@
"require": {
"php": "^7.1",
"league/tactician": "^1.0",
"phpgears/cqrs": "~0.1"
"phpgears/cqrs": "~0.2"
},
"require-dev": {
"brainmaestro/composer-git-hooks": "^2.1",
"friendsofphp/php-cs-fixer": "^2.0",
"infection/infection": "^0.9",
"phpmd/phpmd": "^2.0",
"phpstan/phpstan": "^0.10",
"phpstan/phpstan-deprecation-rules": "^0.10",
"phpstan/phpstan-strict-rules": "^0.10",
"phpstan/phpstan": "^0.11",
"phpstan/phpstan-deprecation-rules": "^0.11",
"phpstan/phpstan-strict-rules": "^0.11",
"phpunit/phpunit": "^6.0|^7.0",
"povils/phpmnd": "^2.0",
"roave/security-advisories": "dev-master",
"sebastian/phpcpd": "^3.0|^4.0",
"squizlabs/php_codesniffer": "^2.0",
"thecodingmachine/phpstan-strict-rules": "^0.10.1"
"thecodingmachine/phpstan-strict-rules": "^0.11"
},
"suggest": {
},
Expand Down
2 changes: 1 addition & 1 deletion src/CommandInflector.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use Gears\CQRS\Command;
use Gears\CQRS\CommandHandler;
use Gears\CQRS\Exception\InvalidCommandException;
use Gears\CQRS\Tactician\Exception\InvalidCommandHandlerException;
use Gears\CQRS\Exception\InvalidCommandHandlerException;
use League\Tactician\Handler\MethodNameInflector\MethodNameInflector;

final class CommandInflector implements MethodNameInflector
Expand Down
18 changes: 0 additions & 18 deletions src/Exception/InvalidCommandHandlerException.php

This file was deleted.

18 changes: 0 additions & 18 deletions src/Exception/InvalidQueryHandlerException.php

This file was deleted.

18 changes: 0 additions & 18 deletions src/Exception/QueryReturnException.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/QueryBus.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

namespace Gears\CQRS\Tactician;

use Gears\CQRS\Exception\QueryReturnException;
use Gears\CQRS\Query;
use Gears\CQRS\QueryBus as QueryBusInterface;
use Gears\CQRS\Tactician\Exception\QueryReturnException;
use Gears\DTO\DTO;
use League\Tactician\CommandBus as TacticianCommandBus;

Expand Down
2 changes: 1 addition & 1 deletion src/QueryInflector.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
namespace Gears\CQRS\Tactician;

use Gears\CQRS\Exception\InvalidQueryException;
use Gears\CQRS\Exception\InvalidQueryHandlerException;
use Gears\CQRS\Query;
use Gears\CQRS\QueryHandler;
use Gears\CQRS\Tactician\Exception\InvalidQueryHandlerException;
use League\Tactician\Handler\MethodNameInflector\MethodNameInflector;

final class QueryInflector implements MethodNameInflector
Expand Down
2 changes: 1 addition & 1 deletion tests/Tactician/CommandInflectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function testInvalidCommand(): void
}

/**
* @expectedException \Gears\CQRS\Tactician\Exception\InvalidCommandHandlerException
* @expectedException \Gears\CQRS\Exception\InvalidCommandHandlerException
* @expectedExceptionMessage Command handler must implement Gears\CQRS\CommandHandler interface, string given
*/
public function testInvalidCommandHandler(): void
Expand Down
2 changes: 1 addition & 1 deletion tests/Tactician/QueryBusTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function testHandling(): void
}

/**
* @expectedException \Gears\CQRS\Tactician\Exception\QueryReturnException
* @expectedException \Gears\CQRS\Exception\QueryReturnException
* @expectedExceptionMessageRegExp /^Query handler for .+\\QueryStub should return an instance of Gears\\DTO\\DTO$/
*/
public function testInvalidReturn(): void
Expand Down
2 changes: 1 addition & 1 deletion tests/Tactician/QueryInflectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function testInvalidCommand(): void
}

/**
* @expectedException \Gears\CQRS\Tactician\Exception\InvalidQueryHandlerException
* @expectedException \Gears\CQRS\Exception\InvalidQueryHandlerException
* @expectedExceptionMessage Query handler must implement Gears\CQRS\QueryHandler interface, string given
*/
public function testInvalidCommandHandler(): void
Expand Down

0 comments on commit a59e611

Please sign in to comment.