diff --git a/src/Exception/AccessDeniedException.php b/src/Exception/AccessDenied.php similarity index 84% rename from src/Exception/AccessDeniedException.php rename to src/Exception/AccessDenied.php index 5e96a80b..642c2f4f 100644 --- a/src/Exception/AccessDeniedException.php +++ b/src/Exception/AccessDenied.php @@ -13,9 +13,9 @@ namespace Prooph\EventStore\Exception; -class AccessDeniedException extends RuntimeException +class AccessDenied extends RuntimeException { - public static function toAllStream(): AccessDeniedException + public static function toAllStream(): AccessDenied { return new self(\sprintf( 'Access to stream \'%s\' is denied', @@ -23,7 +23,7 @@ public static function toAllStream(): AccessDeniedException )); } - public static function toStream(string $stream): AccessDeniedException + public static function toStream(string $stream): AccessDenied { return new self(\sprintf( 'Access to stream \'%s\' is denied', diff --git a/src/Exception/OperationTimedOutException.php b/src/Exception/CannotEstablishConnection.php similarity index 86% rename from src/Exception/OperationTimedOutException.php rename to src/Exception/CannotEstablishConnection.php index b1347ca3..c0c38322 100644 --- a/src/Exception/OperationTimedOutException.php +++ b/src/Exception/CannotEstablishConnection.php @@ -13,6 +13,6 @@ namespace Prooph\EventStore\Exception; -class OperationTimedOutException extends RuntimeException +class CannotEstablishConnection extends RuntimeException { } diff --git a/src/Exception/ConnectionClosedException.php b/src/Exception/ConnectionClosed.php similarity index 87% rename from src/Exception/ConnectionClosedException.php rename to src/Exception/ConnectionClosed.php index 95abc777..7379fb70 100644 --- a/src/Exception/ConnectionClosedException.php +++ b/src/Exception/ConnectionClosed.php @@ -13,9 +13,9 @@ namespace Prooph\EventStore\Exception; -class ConnectionClosedException extends EventStoreConnectionException +class ConnectionClosed extends EventStoreConnectionException { - public static function withName(string $name): ConnectionClosedException + public static function withName(string $name): ConnectionClosed { return new self(\sprintf( 'Connection \'%s\' was closed', diff --git a/src/Exception/InvalidTransactionException.php b/src/Exception/InvalidTransaction.php similarity index 89% rename from src/Exception/InvalidTransactionException.php rename to src/Exception/InvalidTransaction.php index 95c8db61..dbe18ef4 100644 --- a/src/Exception/InvalidTransactionException.php +++ b/src/Exception/InvalidTransaction.php @@ -17,6 +17,6 @@ * Exception thrown if there is an attempt to operate inside a * transaction which does not exist. */ -class InvalidTransactionException extends RuntimeException +class InvalidTransaction extends RuntimeException { } diff --git a/src/Exception/MaxQueueSizeLimitReachedException.php b/src/Exception/MaxQueueSizeLimitReached.php similarity index 86% rename from src/Exception/MaxQueueSizeLimitReachedException.php rename to src/Exception/MaxQueueSizeLimitReached.php index e0fbcabf..a649a117 100644 --- a/src/Exception/MaxQueueSizeLimitReachedException.php +++ b/src/Exception/MaxQueueSizeLimitReached.php @@ -13,9 +13,9 @@ namespace Prooph\EventStore\Exception; -class MaxQueueSizeLimitReachedException extends RuntimeException +class MaxQueueSizeLimitReached extends RuntimeException { - public static function with(string $connectionName, int $maxQueueSize): MaxQueueSizeLimitReachedException + public static function with(string $connectionName, int $maxQueueSize): MaxQueueSizeLimitReached { return new self( \sprintf( diff --git a/src/Exception/ObjectDisposedException.php b/src/Exception/MaximumSubscribersReached.php similarity index 85% rename from src/Exception/ObjectDisposedException.php rename to src/Exception/MaximumSubscribersReached.php index 53256a2e..1eb22eb1 100644 --- a/src/Exception/ObjectDisposedException.php +++ b/src/Exception/MaximumSubscribersReached.php @@ -13,6 +13,6 @@ namespace Prooph\EventStore\Exception; -class ObjectDisposedException extends InvalidOperationException +class MaximumSubscribersReached extends RuntimeException { } diff --git a/src/Exception/NotAuthenticatedException.php b/src/Exception/NotAuthenticated.php similarity index 89% rename from src/Exception/NotAuthenticatedException.php rename to src/Exception/NotAuthenticated.php index 720ed9da..d6d96b71 100644 --- a/src/Exception/NotAuthenticatedException.php +++ b/src/Exception/NotAuthenticated.php @@ -13,7 +13,7 @@ namespace Prooph\EventStore\Exception; -class NotAuthenticatedException extends RuntimeException +class NotAuthenticated extends RuntimeException { public function __construct(string $message = 'Not authenticated') { diff --git a/src/Exception/CannotEstablishConnectionException.php b/src/Exception/ObjectDisposed.php similarity index 85% rename from src/Exception/CannotEstablishConnectionException.php rename to src/Exception/ObjectDisposed.php index c54c5b54..f0398a52 100644 --- a/src/Exception/CannotEstablishConnectionException.php +++ b/src/Exception/ObjectDisposed.php @@ -13,6 +13,6 @@ namespace Prooph\EventStore\Exception; -class CannotEstablishConnectionException extends RuntimeException +class ObjectDisposed extends InvalidOperationException { } diff --git a/src/Exception/OperationTimedOut.php b/src/Exception/OperationTimedOut.php new file mode 100644 index 00000000..ecfd8d30 --- /dev/null +++ b/src/Exception/OperationTimedOut.php @@ -0,0 +1,18 @@ + + * (c) 2015-2019 Sascha-Oliver Prolic + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Prooph\EventStore\Exception; + +class OperationTimedOut extends RuntimeException +{ +} diff --git a/src/Exception/PersistentSubscriptionCommandFailed.php b/src/Exception/PersistentSubscriptionCommandFailed.php new file mode 100644 index 00000000..42e757ae --- /dev/null +++ b/src/Exception/PersistentSubscriptionCommandFailed.php @@ -0,0 +1,18 @@ + + * (c) 2015-2019 Sascha-Oliver Prolic + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Prooph\EventStore\Exception; + +class PersistentSubscriptionCommandFailed extends EventStoreConnectionException +{ +} diff --git a/src/Exception/PersistentSubscriptionCommandFailedException.php b/src/Exception/PersistentSubscriptionCommandFailedException.php deleted file mode 100644 index 9ee077b5..00000000 --- a/src/Exception/PersistentSubscriptionCommandFailedException.php +++ /dev/null @@ -1,18 +0,0 @@ - - * (c) 2015-2019 Sascha-Oliver Prolic - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Prooph\EventStore\Exception; - -class PersistentSubscriptionCommandFailedException extends EventStoreConnectionException -{ -} diff --git a/src/Exception/PersistentSubscriptionDeleted.php b/src/Exception/PersistentSubscriptionDeleted.php new file mode 100644 index 00000000..eb6cfa5f --- /dev/null +++ b/src/Exception/PersistentSubscriptionDeleted.php @@ -0,0 +1,18 @@ + + * (c) 2015-2019 Sascha-Oliver Prolic + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Prooph\EventStore\Exception; + +class PersistentSubscriptionDeleted extends RuntimeException +{ +} diff --git a/src/Exception/PersistentSubscriptionDeletedException.php b/src/Exception/PersistentSubscriptionDeletedException.php deleted file mode 100644 index 7f5858db..00000000 --- a/src/Exception/PersistentSubscriptionDeletedException.php +++ /dev/null @@ -1,18 +0,0 @@ - - * (c) 2015-2019 Sascha-Oliver Prolic - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Prooph\EventStore\Exception; - -class PersistentSubscriptionDeletedException extends RuntimeException -{ -} diff --git a/src/Exception/ProjectionCommandConflict.php b/src/Exception/ProjectionCommandConflict.php new file mode 100644 index 00000000..4eec616c --- /dev/null +++ b/src/Exception/ProjectionCommandConflict.php @@ -0,0 +1,18 @@ + + * (c) 2015-2019 Sascha-Oliver Prolic + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Prooph\EventStore\Exception; + +class ProjectionCommandConflict extends ProjectionCommandFailed +{ +} diff --git a/src/Exception/ProjectionCommandConflictException.php b/src/Exception/ProjectionCommandConflictException.php deleted file mode 100644 index dc58a1ca..00000000 --- a/src/Exception/ProjectionCommandConflictException.php +++ /dev/null @@ -1,18 +0,0 @@ - - * (c) 2015-2019 Sascha-Oliver Prolic - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Prooph\EventStore\Exception; - -class ProjectionCommandConflictException extends ProjectionCommandFailedException -{ -} diff --git a/src/Exception/MaximumSubscribersReachedException.php b/src/Exception/ProjectionCommandFailed.php similarity index 85% rename from src/Exception/MaximumSubscribersReachedException.php rename to src/Exception/ProjectionCommandFailed.php index 0f2a2b1b..0b905944 100644 --- a/src/Exception/MaximumSubscribersReachedException.php +++ b/src/Exception/ProjectionCommandFailed.php @@ -13,6 +13,6 @@ namespace Prooph\EventStore\Exception; -class MaximumSubscribersReachedException extends RuntimeException +class ProjectionCommandFailed extends EventStoreConnectionException { } diff --git a/src/Exception/ProjectionCommandFailedException.php b/src/Exception/ProjectionCommandFailedException.php deleted file mode 100644 index 62149ad6..00000000 --- a/src/Exception/ProjectionCommandFailedException.php +++ /dev/null @@ -1,18 +0,0 @@ - - * (c) 2015-2019 Sascha-Oliver Prolic - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Prooph\EventStore\Exception; - -class ProjectionCommandFailedException extends EventStoreConnectionException -{ -} diff --git a/src/Exception/RetriesLimitReachedException.php b/src/Exception/RetriesLimitReached.php similarity index 89% rename from src/Exception/RetriesLimitReachedException.php rename to src/Exception/RetriesLimitReached.php index 6eed1666..da902990 100644 --- a/src/Exception/RetriesLimitReachedException.php +++ b/src/Exception/RetriesLimitReached.php @@ -13,9 +13,9 @@ namespace Prooph\EventStore\Exception; -class RetriesLimitReachedException extends RuntimeException +class RetriesLimitReached extends RuntimeException { - public static function with(int $retries): RetriesLimitReachedException + public static function with(int $retries): RetriesLimitReached { return new self( \sprintf( diff --git a/src/Exception/StreamDeletedException.php b/src/Exception/StreamDeleted.php similarity index 80% rename from src/Exception/StreamDeletedException.php rename to src/Exception/StreamDeleted.php index 284f27ef..f9aff2da 100644 --- a/src/Exception/StreamDeletedException.php +++ b/src/Exception/StreamDeleted.php @@ -13,9 +13,9 @@ namespace Prooph\EventStore\Exception; -class StreamDeletedException extends RuntimeException +class StreamDeleted extends RuntimeException { - public static function with(string $stream): StreamDeletedException + public static function with(string $stream): StreamDeleted { return new self(\sprintf( 'Stream \'%s\' is deleted', diff --git a/src/Exception/TimeoutException.php b/src/Exception/Timeout.php similarity index 88% rename from src/Exception/TimeoutException.php rename to src/Exception/Timeout.php index 50d05009..ae85a256 100644 --- a/src/Exception/TimeoutException.php +++ b/src/Exception/Timeout.php @@ -13,6 +13,6 @@ namespace Prooph\EventStore\Exception; -class TimeoutException extends RuntimeException +class Timeout extends RuntimeException { } diff --git a/src/Exception/UnexpectedCommandException.php b/src/Exception/UnexpectedCommand.php similarity index 86% rename from src/Exception/UnexpectedCommandException.php rename to src/Exception/UnexpectedCommand.php index a17fca14..6625b422 100644 --- a/src/Exception/UnexpectedCommandException.php +++ b/src/Exception/UnexpectedCommand.php @@ -13,9 +13,9 @@ namespace Prooph\EventStore\Exception; -class UnexpectedCommandException extends RuntimeException +class UnexpectedCommand extends RuntimeException { - public static function withName(string $actualCommand): UnexpectedCommandException + public static function withName(string $actualCommand): UnexpectedCommand { return new self(\sprintf( 'Unexpected command \'%s\'', @@ -23,7 +23,7 @@ public static function withName(string $actualCommand): UnexpectedCommandExcepti )); } - public static function with(string $expectedCommand, string $actualCommand): UnexpectedCommandException + public static function with(string $expectedCommand, string $actualCommand): UnexpectedCommand { return new self(\sprintf( 'Unexpected command \'%s\': expected \'%s\'', diff --git a/src/Exception/UserCommandConflict.php b/src/Exception/UserCommandConflict.php new file mode 100644 index 00000000..c22ff4ed --- /dev/null +++ b/src/Exception/UserCommandConflict.php @@ -0,0 +1,18 @@ + + * (c) 2015-2019 Sascha-Oliver Prolic + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Prooph\EventStore\Exception; + +class UserCommandConflict extends ProjectionCommandFailed +{ +} diff --git a/src/Exception/UserCommandConflictException.php b/src/Exception/UserCommandConflictException.php deleted file mode 100644 index 5fd6704a..00000000 --- a/src/Exception/UserCommandConflictException.php +++ /dev/null @@ -1,18 +0,0 @@ - - * (c) 2015-2019 Sascha-Oliver Prolic - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Prooph\EventStore\Exception; - -class UserCommandConflictException extends ProjectionCommandFailedException -{ -} diff --git a/src/Exception/UserCommandFailed.php b/src/Exception/UserCommandFailed.php new file mode 100644 index 00000000..0824307c --- /dev/null +++ b/src/Exception/UserCommandFailed.php @@ -0,0 +1,18 @@ + + * (c) 2015-2019 Sascha-Oliver Prolic + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +declare(strict_types=1); + +namespace Prooph\EventStore\Exception; + +class UserCommandFailed extends EventStoreConnectionException +{ +} diff --git a/src/Exception/UserCommandFailedException.php b/src/Exception/UserCommandFailedException.php deleted file mode 100644 index 0dd6e010..00000000 --- a/src/Exception/UserCommandFailedException.php +++ /dev/null @@ -1,18 +0,0 @@ - - * (c) 2015-2019 Sascha-Oliver Prolic - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -declare(strict_types=1); - -namespace Prooph\EventStore\Exception; - -class UserCommandFailedException extends EventStoreConnectionException -{ -} diff --git a/src/Exception/WrongExpectedVersionException.php b/src/Exception/WrongExpectedVersion.php similarity index 89% rename from src/Exception/WrongExpectedVersionException.php rename to src/Exception/WrongExpectedVersion.php index f2234be8..a3308abb 100644 --- a/src/Exception/WrongExpectedVersionException.php +++ b/src/Exception/WrongExpectedVersion.php @@ -13,13 +13,13 @@ namespace Prooph\EventStore\Exception; -class WrongExpectedVersionException extends RuntimeException +class WrongExpectedVersion extends RuntimeException { public static function with( string $stream, int $expectedVersion, ?int $currentVersion = null - ): WrongExpectedVersionException { + ): WrongExpectedVersion { $message = 'Operation failed due to WrongExpectedVersion. Stream: \'%s\', Expected version: %d'; if (null !== $currentVersion) { diff --git a/src/UserManagement/AsyncUsersManager.php b/src/UserManagement/AsyncUsersManager.php index a20d2b6a..254e63b5 100644 --- a/src/UserManagement/AsyncUsersManager.php +++ b/src/UserManagement/AsyncUsersManager.php @@ -14,7 +14,7 @@ namespace Prooph\EventStore\UserManagement; use Amp\Promise; -use Prooph\EventStore\Exception\UserCommandFailedException; +use Prooph\EventStore\Exception\UserCommandFailed; use Prooph\EventStore\UserCredentials; interface AsyncUsersManager @@ -23,7 +23,7 @@ public function enableAsync(string $login, ?UserCredentials $userCredentials = n public function disableAsync(string $login, ?UserCredentials $userCredentials = null): Promise; - /** @throws UserCommandFailedException */ + /** @throws UserCommandFailed */ public function deleteUserAsync(string $login, ?UserCredentials $userCredentials = null): Promise; /** @return Promise */ diff --git a/src/UserManagement/UsersManager.php b/src/UserManagement/UsersManager.php index 756ae67c..286589f7 100644 --- a/src/UserManagement/UsersManager.php +++ b/src/UserManagement/UsersManager.php @@ -13,7 +13,7 @@ namespace Prooph\EventStore\UserManagement; -use Prooph\EventStore\Exception\UserCommandFailedException; +use Prooph\EventStore\Exception\UserCommandFailed; use Prooph\EventStore\UserCredentials; interface UsersManager @@ -22,7 +22,7 @@ public function enable(string $login, ?UserCredentials $userCredentials = null): public function disable(string $login, ?UserCredentials $userCredentials = null): void; - /** @throws UserCommandFailedException */ + /** @throws UserCommandFailed */ public function deleteUser(string $login, ?UserCredentials $userCredentials = null): void; /** @return UserDetails[] */