-
Notifications
You must be signed in to change notification settings - Fork 772
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The class had too much complexity and some duplication on its children. I started doing this because I'm refactoring the tests to upgrade PHPUnit later, and then I made some improvements along the way. Signed-off-by: Henrique Moody <[email protected]>
- Loading branch information
1 parent
e983e52
commit ae1620b
Showing
11 changed files
with
223 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright (c) Alexandre Gomes Gaigalas <[email protected]> | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Respect\Validation\Test\Exceptions; | ||
|
||
use Respect\Validation\Exceptions\NestedValidationException; | ||
|
||
final class CompositeStubException extends NestedValidationException | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
/* | ||
* Copyright (c) Alexandre Gomes Gaigalas <[email protected]> | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Respect\Validation\Test\Stubs; | ||
|
||
use Respect\Validation\Message\Formatter; | ||
use Respect\Validation\Message\Stringifier\KeepOriginalStringName; | ||
use Respect\Validation\Rules\AbstractComposite; | ||
use Respect\Validation\Test\Exceptions\CompositeStubException; | ||
|
||
final class CompositeSub extends AbstractComposite | ||
{ | ||
public function validate(mixed $input): bool | ||
{ | ||
return true; | ||
} | ||
|
||
/** | ||
* @param array<string, mixed> $extraParameters | ||
*/ | ||
public function reportError(mixed $input, array $extraParameters = []): CompositeStubException | ||
{ | ||
return new CompositeStubException( | ||
input: $input, | ||
id: 'CompositeStub', | ||
params: $extraParameters, | ||
formatter: new Formatter(static fn ($value) => $value, new KeepOriginalStringName()) | ||
); | ||
} | ||
} |
Oops, something went wrong.