Remove "Interface" suffix from exceptions

Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
This commit is contained in:
Henrique Moody 2018-05-24 08:25:57 +02:00
parent 167c97bb83
commit d7ebb8c1a7
No known key found for this signature in database
GPG key ID: 221E9281655813A6
12 changed files with 17 additions and 17 deletions

View file

@ -124,10 +124,10 @@ $usernameValidator->validate('#$%'); //false
## Exception types
- `Respect\Validation\Exceptions\ExceptionInterface`:
- `Respect\Validation\Exceptions\Exception`:
- All exceptions implement this interface;
- `Respect\Validation\Exceptions\ValidationException`:
- Implements the `Respect\Validation\Exceptions\ExceptionInterface` interface
- Implements the `Respect\Validation\Exceptions\Exception` interface
- Thrown when the `check()` fails
- All validation exceptions extend this class
- Available methods:

View file

@ -13,7 +13,7 @@ declare(strict_types=1);
namespace Respect\Validation\Exceptions;
class AttributeException extends NestedValidationException implements NonOmissibleExceptionInterface
class AttributeException extends NestedValidationException implements NonOmissibleException
{
public const NOT_PRESENT = 'not_present';
public const INVALID = 'invalid';

View file

@ -13,6 +13,6 @@ declare(strict_types=1);
namespace Respect\Validation\Exceptions;
class CallException extends GroupedValidationException implements NonOmissibleExceptionInterface
class CallException extends GroupedValidationException implements NonOmissibleException
{
}

View file

@ -13,8 +13,6 @@ declare(strict_types=1);
namespace Respect\Validation\Exceptions;
use Exception;
class ComponentException extends Exception implements ExceptionInterface
class ComponentException extends \Exception implements Exception
{
}

View file

@ -13,6 +13,8 @@ declare(strict_types=1);
namespace Respect\Validation\Exceptions;
interface NonOmissibleExceptionInterface extends ExceptionInterface
use Throwable;
interface Exception extends Throwable
{
}

View file

@ -13,7 +13,7 @@ declare(strict_types=1);
namespace Respect\Validation\Exceptions;
class KeyException extends AttributeException implements NonOmissibleExceptionInterface
class KeyException extends AttributeException implements NonOmissibleException
{
public static $defaultTemplates = [
self::MODE_DEFAULT => [

View file

@ -13,7 +13,7 @@ declare(strict_types=1);
namespace Respect\Validation\Exceptions;
class KeyNestedException extends AttributeException implements NonOmissibleExceptionInterface
class KeyNestedException extends AttributeException implements NonOmissibleException
{
public static $defaultTemplates = [
self::MODE_DEFAULT => [

View file

@ -13,7 +13,7 @@ declare(strict_types=1);
namespace Respect\Validation\Exceptions;
class KeySetException extends GroupedValidationException implements NonOmissibleExceptionInterface
class KeySetException extends GroupedValidationException implements NonOmissibleException
{
public const STRUCTURE = 'structure';

View file

@ -53,11 +53,11 @@ class NestedValidationException extends ValidationException implements IteratorA
/**
* Returns weather an exception should be omitted or not.
*
* @param ExceptionInterface $exception
* @param Exception $exception
*
* @return bool
*/
private function isOmissible(ExceptionInterface $exception)
private function isOmissible(Exception $exception)
{
if (!$exception instanceof self) {
return false;
@ -67,7 +67,7 @@ class NestedValidationException extends ValidationException implements IteratorA
$relatedExceptions->rewind();
$childException = $relatedExceptions->current();
return 1 === $relatedExceptions->count() && !$childException instanceof NonOmissibleExceptionInterface;
return 1 === $relatedExceptions->count() && !$childException instanceof NonOmissibleException;
}
/**

View file

@ -13,6 +13,6 @@ declare(strict_types=1);
namespace Respect\Validation\Exceptions;
interface ExceptionInterface
interface NonOmissibleException extends Exception
{
}

View file

@ -18,7 +18,7 @@ use function in_array;
use function is_numeric;
use function Respect\Stringifier\stringify;
class ValidationException extends InvalidArgumentException implements ExceptionInterface
class ValidationException extends InvalidArgumentException implements Exception
{
public const MODE_DEFAULT = 'default';
public const MODE_NEGATIVE = 'negative';

View file

@ -20,7 +20,7 @@ class ValidationExceptionTest extends TestCase
public function testItImplementsExceptionInterface(): void
{
$validationException = new ValidationException();
self::assertInstanceOf(ExceptionInterface::class, $validationException);
self::assertInstanceOf(Exception::class, $validationException);
}
/**