Skip to content

Commit

Permalink
refactor: reorganize exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
priyadi committed Jun 20, 2024
1 parent c3a89cb commit 39f2293
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.3.1

* refactor: reorganize exceptions

## 0.3.0

* feat: add `SafePageableCollection` and `SafeReadablePageableCollection`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

namespace Rekalogika\Domain\Collections\Common\Exception;

use Rekalogika\Contracts\Collections\Exception\BadMethodCallException;

class CountDisabledException extends BadMethodCallException
{
public function __construct()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
18 changes: 18 additions & 0 deletions packages/collections-contracts/src/Exception/LogicException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

/*
* This file is part of rekalogika/collections package.
*
* (c) Priyadi Iman Nurcahyo <https://rekalogika.dev>
*
* 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
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
18 changes: 18 additions & 0 deletions packages/collections-contracts/src/Exception/RuntimeException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

/*
* This file is part of rekalogika/collections package.
*
* (c) Priyadi Iman Nurcahyo <https://rekalogika.dev>
*
* 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
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion packages/collections-domain/src/CriteriaRecollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/collections-domain/src/RecollectionDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 39f2293

Please sign in to comment.