diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fc1bc7..cd6c33d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.3.1 + +* refactor: reorganize exceptions + ## 0.3.0 * feat: add `SafePageableCollection` and `SafeReadablePageableCollection` diff --git a/packages/collections-common/src/Exception/CountDisabledException.php b/packages/collections-common/src/Exception/CountDisabledException.php index 50c8a4b..df40655 100644 --- a/packages/collections-common/src/Exception/CountDisabledException.php +++ b/packages/collections-common/src/Exception/CountDisabledException.php @@ -13,6 +13,8 @@ namespace Rekalogika\Domain\Collections\Common\Exception; +use Rekalogika\Contracts\Collections\Exception\BadMethodCallException; + class CountDisabledException extends BadMethodCallException { public function __construct() diff --git a/packages/collections-common/src/Trait/ItemsWithSafeguardTrait.php b/packages/collections-common/src/Trait/ItemsWithSafeguardTrait.php index 63f65d2..80a53e8 100644 --- a/packages/collections-common/src/Trait/ItemsWithSafeguardTrait.php +++ b/packages/collections-common/src/Trait/ItemsWithSafeguardTrait.php @@ -13,8 +13,8 @@ namespace Rekalogika\Domain\Collections\Common\Trait; +use Rekalogika\Contracts\Collections\Exception\OverflowException; use Rekalogika\Domain\Collections\Common\Configuration; -use Rekalogika\Domain\Collections\Common\Exception\OverflowException; /** * @template TKey of array-key diff --git a/packages/collections-common/src/Exception/BadMethodCallException.php b/packages/collections-contracts/src/Exception/BadMethodCallException.php similarity index 86% rename from packages/collections-common/src/Exception/BadMethodCallException.php rename to packages/collections-contracts/src/Exception/BadMethodCallException.php index b0bdaee..8b8dafd 100644 --- a/packages/collections-common/src/Exception/BadMethodCallException.php +++ b/packages/collections-contracts/src/Exception/BadMethodCallException.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\Domain\Collections\Common\Exception; +namespace Rekalogika\Contracts\Collections\Exception; class BadMethodCallException extends \BadMethodCallException implements ExceptionInterface { diff --git a/packages/collections-common/src/Exception/ExceptionInterface.php b/packages/collections-contracts/src/Exception/ExceptionInterface.php similarity index 85% rename from packages/collections-common/src/Exception/ExceptionInterface.php rename to packages/collections-contracts/src/Exception/ExceptionInterface.php index 331a1f4..a4ec4f0 100644 --- a/packages/collections-common/src/Exception/ExceptionInterface.php +++ b/packages/collections-contracts/src/Exception/ExceptionInterface.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\Domain\Collections\Common\Exception; +namespace Rekalogika\Contracts\Collections\Exception; interface ExceptionInterface extends \Throwable { diff --git a/packages/collections-contracts/src/Exception/LogicException.php b/packages/collections-contracts/src/Exception/LogicException.php new file mode 100644 index 0000000..a5ff4e2 --- /dev/null +++ b/packages/collections-contracts/src/Exception/LogicException.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE file + * that was distributed with this source code. + */ + +namespace Rekalogika\Contracts\Collections\Exception; + +class LogicException extends \LogicException implements ExceptionInterface +{ +} diff --git a/packages/collections-common/src/Exception/OverflowException.php b/packages/collections-contracts/src/Exception/OverflowException.php similarity index 86% rename from packages/collections-common/src/Exception/OverflowException.php rename to packages/collections-contracts/src/Exception/OverflowException.php index f098712..a20bdc6 100644 --- a/packages/collections-common/src/Exception/OverflowException.php +++ b/packages/collections-contracts/src/Exception/OverflowException.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\Domain\Collections\Common\Exception; +namespace Rekalogika\Contracts\Collections\Exception; class OverflowException extends \OverflowException implements ExceptionInterface { diff --git a/packages/collections-contracts/src/Exception/RuntimeException.php b/packages/collections-contracts/src/Exception/RuntimeException.php new file mode 100644 index 0000000..b92f650 --- /dev/null +++ b/packages/collections-contracts/src/Exception/RuntimeException.php @@ -0,0 +1,18 @@ + + * + * For the full copyright and license information, please view the LICENSE file + * that was distributed with this source code. + */ + +namespace Rekalogika\Contracts\Collections\Exception; + +class RuntimeException extends \RuntimeException implements ExceptionInterface +{ +} diff --git a/packages/collections-common/src/Exception/UnexpectedValueException.php b/packages/collections-contracts/src/Exception/UnexpectedValueException.php similarity index 86% rename from packages/collections-common/src/Exception/UnexpectedValueException.php rename to packages/collections-contracts/src/Exception/UnexpectedValueException.php index fcce2f9..33dc682 100644 --- a/packages/collections-common/src/Exception/UnexpectedValueException.php +++ b/packages/collections-contracts/src/Exception/UnexpectedValueException.php @@ -11,7 +11,7 @@ * that was distributed with this source code. */ -namespace Rekalogika\Domain\Collections\Common\Exception; +namespace Rekalogika\Contracts\Collections\Exception; class UnexpectedValueException extends \UnexpectedValueException implements ExceptionInterface { diff --git a/packages/collections-domain/src/CriteriaRecollection.php b/packages/collections-domain/src/CriteriaRecollection.php index 587a27e..19d5bfa 100644 --- a/packages/collections-domain/src/CriteriaRecollection.php +++ b/packages/collections-domain/src/CriteriaRecollection.php @@ -18,9 +18,9 @@ use Doctrine\Common\Collections\Order; use Doctrine\Common\Collections\ReadableCollection; use Doctrine\Common\Collections\Selectable; +use Rekalogika\Contracts\Collections\Exception\UnexpectedValueException; use Rekalogika\Contracts\Collections\ReadableRecollection; use Rekalogika\Domain\Collections\Common\CountStrategy; -use Rekalogika\Domain\Collections\Common\Exception\UnexpectedValueException; use Rekalogika\Domain\Collections\Common\Trait\ItemsWithSafeguardTrait; use Rekalogika\Domain\Collections\Common\Trait\PageableTrait; use Rekalogika\Domain\Collections\Trait\ExtraLazyDetectorTrait; diff --git a/packages/collections-domain/src/RecollectionDecorator.php b/packages/collections-domain/src/RecollectionDecorator.php index c8a96ac..45e32b3 100644 --- a/packages/collections-domain/src/RecollectionDecorator.php +++ b/packages/collections-domain/src/RecollectionDecorator.php @@ -17,10 +17,10 @@ use Doctrine\Common\Collections\Criteria; use Doctrine\Common\Collections\Order; use Doctrine\Common\Collections\Selectable; +use Rekalogika\Contracts\Collections\Exception\UnexpectedValueException; use Rekalogika\Contracts\Collections\Recollection; use Rekalogika\Domain\Collections\Common\Configuration; use Rekalogika\Domain\Collections\Common\CountStrategy; -use Rekalogika\Domain\Collections\Common\Exception\UnexpectedValueException; use Rekalogika\Domain\Collections\Common\Trait\ItemsWithSafeguardTrait; use Rekalogika\Domain\Collections\Common\Trait\PageableTrait; use Rekalogika\Domain\Collections\Trait\ExtraLazyDetectorTrait; diff --git a/packages/collections-domain/src/SafeCriteriaRecollection.php b/packages/collections-domain/src/SafeCriteriaRecollection.php index 1eeb270..72a8590 100644 --- a/packages/collections-domain/src/SafeCriteriaRecollection.php +++ b/packages/collections-domain/src/SafeCriteriaRecollection.php @@ -18,9 +18,9 @@ use Doctrine\Common\Collections\Order; use Doctrine\Common\Collections\ReadableCollection; use Doctrine\Common\Collections\Selectable; +use Rekalogika\Contracts\Collections\Exception\UnexpectedValueException; use Rekalogika\Contracts\Collections\SafeReadableRecollection; use Rekalogika\Domain\Collections\Common\CountStrategy; -use Rekalogika\Domain\Collections\Common\Exception\UnexpectedValueException; use Rekalogika\Domain\Collections\Common\Trait\CountableTrait; use Rekalogika\Domain\Collections\Common\Trait\ItemsWithSafeguardTrait; use Rekalogika\Domain\Collections\Common\Trait\PageableTrait; diff --git a/packages/collections-domain/src/SafeRecollectionDecorator.php b/packages/collections-domain/src/SafeRecollectionDecorator.php index 5866a4a..ad1d310 100644 --- a/packages/collections-domain/src/SafeRecollectionDecorator.php +++ b/packages/collections-domain/src/SafeRecollectionDecorator.php @@ -17,10 +17,10 @@ use Doctrine\Common\Collections\Criteria; use Doctrine\Common\Collections\Order; use Doctrine\Common\Collections\Selectable; +use Rekalogika\Contracts\Collections\Exception\UnexpectedValueException; use Rekalogika\Contracts\Collections\SafeRecollection; use Rekalogika\Domain\Collections\Common\Configuration; use Rekalogika\Domain\Collections\Common\CountStrategy; -use Rekalogika\Domain\Collections\Common\Exception\UnexpectedValueException; use Rekalogika\Domain\Collections\Common\Trait\CountableTrait; use Rekalogika\Domain\Collections\Common\Trait\ItemsWithSafeguardTrait; use Rekalogika\Domain\Collections\Common\Trait\PageableTrait;