diff --git a/CHANGELOG.md b/CHANGELOG.md index cfcb2c7d..2c96bafe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,8 @@ All notable changes of the Respect\Validation releases are documented in this fi - On exceptions, improve `Object` conversion to string (#399) - On exceptions, improve conversion of all values by using JSON (#399) - On exceptions, nested messages are displayed in a Markdown list (#588) +- Rename exception class "AbstractGroupedException" to "GroupedValidationException" (#591) +- Rename exception class "AbstractNestedException" to "NestedValidationException" (#591) - Rename rule "Arr" to "ArrayVal" - Rename rule "Bool" to "BoolType" (#426) - Rename rule "False" to "FalseVal" (#426) diff --git a/library/Exceptions/AgeException.php b/library/Exceptions/AgeException.php index eaafa687..1beccc6f 100644 --- a/library/Exceptions/AgeException.php +++ b/library/Exceptions/AgeException.php @@ -11,7 +11,7 @@ namespace Respect\Validation\Exceptions; -class AgeException extends AbstractNestedException +class AgeException extends NestedValidationException { const BOTH = 0; const LOWER = 1; diff --git a/library/Exceptions/AllOfException.php b/library/Exceptions/AllOfException.php index 92ef6d24..73c93b91 100644 --- a/library/Exceptions/AllOfException.php +++ b/library/Exceptions/AllOfException.php @@ -11,7 +11,7 @@ namespace Respect\Validation\Exceptions; -class AllOfException extends AbstractGroupedException +class AllOfException extends GroupedValidationException { public static $defaultTemplates = [ self::MODE_DEFAULT => [ diff --git a/library/Exceptions/AtLeastException.php b/library/Exceptions/AtLeastException.php index 499303d6..d9e0743a 100644 --- a/library/Exceptions/AtLeastException.php +++ b/library/Exceptions/AtLeastException.php @@ -11,7 +11,7 @@ namespace Respect\Validation\Exceptions; -class AtLeastException extends AbstractGroupedException +class AtLeastException extends GroupedValidationException { public static $defaultTemplates = [ self::MODE_DEFAULT => [ diff --git a/library/Exceptions/AttributeException.php b/library/Exceptions/AttributeException.php index 2b4a24c4..5397361a 100644 --- a/library/Exceptions/AttributeException.php +++ b/library/Exceptions/AttributeException.php @@ -11,7 +11,7 @@ namespace Respect\Validation\Exceptions; -class AttributeException extends AbstractNestedException +class AttributeException extends NestedValidationException { const NOT_PRESENT = 0; const INVALID = 1; diff --git a/library/Exceptions/BetweenException.php b/library/Exceptions/BetweenException.php index 6a4aa1b9..21c07692 100644 --- a/library/Exceptions/BetweenException.php +++ b/library/Exceptions/BetweenException.php @@ -11,7 +11,7 @@ namespace Respect\Validation\Exceptions; -class BetweenException extends AbstractNestedException +class BetweenException extends NestedValidationException { const BOTH = 0; const LOWER = 1; diff --git a/library/Exceptions/CallException.php b/library/Exceptions/CallException.php index 80fab908..12b55296 100644 --- a/library/Exceptions/CallException.php +++ b/library/Exceptions/CallException.php @@ -11,6 +11,6 @@ namespace Respect\Validation\Exceptions; -class CallException extends AbstractGroupedException +class CallException extends GroupedValidationException { } diff --git a/library/Exceptions/CallbackException.php b/library/Exceptions/CallbackException.php index 3e964cf9..40ec0815 100644 --- a/library/Exceptions/CallbackException.php +++ b/library/Exceptions/CallbackException.php @@ -11,7 +11,7 @@ namespace Respect\Validation\Exceptions; -class CallbackException extends AbstractNestedException +class CallbackException extends NestedValidationException { public static $defaultTemplates = [ self::MODE_DEFAULT => [ diff --git a/library/Exceptions/DomainException.php b/library/Exceptions/DomainException.php index 2c7f6956..333bb5f9 100644 --- a/library/Exceptions/DomainException.php +++ b/library/Exceptions/DomainException.php @@ -11,7 +11,7 @@ namespace Respect\Validation\Exceptions; -class DomainException extends AbstractNestedException +class DomainException extends NestedValidationException { public static $defaultTemplates = [ self::MODE_DEFAULT => [ diff --git a/library/Exceptions/EachException.php b/library/Exceptions/EachException.php index 243c5cbf..0fe07d22 100644 --- a/library/Exceptions/EachException.php +++ b/library/Exceptions/EachException.php @@ -11,7 +11,7 @@ namespace Respect\Validation\Exceptions; -class EachException extends AbstractNestedException +class EachException extends NestedValidationException { public static $defaultTemplates = [ self::MODE_DEFAULT => [ diff --git a/library/Exceptions/AbstractGroupedException.php b/library/Exceptions/GroupedValidationException.php similarity index 93% rename from library/Exceptions/AbstractGroupedException.php rename to library/Exceptions/GroupedValidationException.php index 231b8662..0efb41f7 100644 --- a/library/Exceptions/AbstractGroupedException.php +++ b/library/Exceptions/GroupedValidationException.php @@ -11,7 +11,7 @@ namespace Respect\Validation\Exceptions; -class AbstractGroupedException extends AbstractNestedException +class GroupedValidationException extends NestedValidationException { const NONE = 0; const SOME = 1; diff --git a/library/Exceptions/KeySetException.php b/library/Exceptions/KeySetException.php index 3e25cf12..89fe6b00 100644 --- a/library/Exceptions/KeySetException.php +++ b/library/Exceptions/KeySetException.php @@ -11,7 +11,7 @@ namespace Respect\Validation\Exceptions; -class KeySetException extends AbstractGroupedException +class KeySetException extends GroupedValidationException { const STRUCTURE = 2; diff --git a/library/Exceptions/AbstractNestedException.php b/library/Exceptions/NestedValidationException.php similarity index 98% rename from library/Exceptions/AbstractNestedException.php rename to library/Exceptions/NestedValidationException.php index 1c6fd21a..71d1d83a 100644 --- a/library/Exceptions/AbstractNestedException.php +++ b/library/Exceptions/NestedValidationException.php @@ -14,7 +14,7 @@ namespace Respect\Validation\Exceptions; use RecursiveIteratorIterator; use SplObjectStorage; -class AbstractNestedException extends ValidationException implements NestedValidationExceptionInterface +class NestedValidationException extends ValidationException implements NestedValidationExceptionInterface { /** * @var SplObjectStorage diff --git a/library/Exceptions/NoneOfException.php b/library/Exceptions/NoneOfException.php index f86716f3..244f111f 100644 --- a/library/Exceptions/NoneOfException.php +++ b/library/Exceptions/NoneOfException.php @@ -11,7 +11,7 @@ namespace Respect\Validation\Exceptions; -class NoneOfException extends AbstractNestedException +class NoneOfException extends NestedValidationException { public static $defaultTemplates = [ self::MODE_DEFAULT => [ diff --git a/library/Exceptions/NotException.php b/library/Exceptions/NotException.php index fb69fb42..e3bc28ae 100644 --- a/library/Exceptions/NotException.php +++ b/library/Exceptions/NotException.php @@ -11,6 +11,6 @@ namespace Respect\Validation\Exceptions; -class NotException extends AbstractGroupedException +class NotException extends GroupedValidationException { } diff --git a/library/Exceptions/OneOfException.php b/library/Exceptions/OneOfException.php index 16b7fdb4..a1720c74 100644 --- a/library/Exceptions/OneOfException.php +++ b/library/Exceptions/OneOfException.php @@ -11,7 +11,7 @@ namespace Respect\Validation\Exceptions; -class OneOfException extends AbstractNestedException +class OneOfException extends NestedValidationException { public static $defaultTemplates = [ self::MODE_DEFAULT => [ diff --git a/library/Exceptions/RecursiveExceptionIterator.php b/library/Exceptions/RecursiveExceptionIterator.php index 7c612f04..9aed534b 100644 --- a/library/Exceptions/RecursiveExceptionIterator.php +++ b/library/Exceptions/RecursiveExceptionIterator.php @@ -18,7 +18,7 @@ class RecursiveExceptionIterator implements RecursiveIterator, Countable { private $exceptions; - public function __construct(AbstractNestedException $parent) + public function __construct(NestedValidationException $parent) { $this->exceptions = $parent->getRelated(); } @@ -34,7 +34,7 @@ class RecursiveExceptionIterator implements RecursiveIterator, Countable return false; } - return ($this->current() instanceof AbstractNestedException); + return ($this->current() instanceof NestedValidationException); } public function getChildren() diff --git a/library/Exceptions/ZendException.php b/library/Exceptions/ZendException.php index f116475d..3fcffcac 100644 --- a/library/Exceptions/ZendException.php +++ b/library/Exceptions/ZendException.php @@ -11,7 +11,7 @@ namespace Respect\Validation\Exceptions; -class ZendException extends AbstractNestedException +class ZendException extends NestedValidationException { public static $defaultTemplates = [ self::MODE_DEFAULT => [ diff --git a/tests/unit/Exceptions/AbstractNestedExceptionTest.php b/tests/unit/Exceptions/NestedValidationExceptionTest.php similarity index 91% rename from tests/unit/Exceptions/AbstractNestedExceptionTest.php rename to tests/unit/Exceptions/NestedValidationExceptionTest.php index a28a7529..d24ce37b 100644 --- a/tests/unit/Exceptions/AbstractNestedExceptionTest.php +++ b/tests/unit/Exceptions/NestedValidationExceptionTest.php @@ -15,15 +15,15 @@ namespace Respect\Validation\Exceptions; * phpunit has an issue with mocking exceptions when in HHVM: * https://github.com/sebastianbergmann/phpunit-mock-objects/issues/207 */ -class PrivateAbstractNestedException extends AbstractNestedException +class PrivateNestedValidationException extends NestedValidationException { } -class AbstractNestedExceptionTest extends \PHPUnit_Framework_TestCase +class NestedValidationExceptionTest extends \PHPUnit_Framework_TestCase { public function testItImplementsNestedValidationExceptionInterface() { - $abstractNestedException = new PrivateAbstractNestedException(); + $abstractNestedException = new PrivateNestedValidationException(); $this->assertInstanceOf('Respect\Validation\Exceptions\NestedValidationExceptionInterface', $abstractNestedException); }