mirror of
https://github.com/Respect/Validation.git
synced 2024-05-15 04:36:40 +02:00
Move mixin classes to the "Mixin" namespace
Just to make the root directory cleaner. Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
This commit is contained in:
parent
cea77d2a46
commit
c946f16f60
|
@ -7,9 +7,10 @@
|
|||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Respect\Validation;
|
||||
namespace Respect\Validation\Mixins;
|
||||
|
||||
use finfo;
|
||||
use Respect\Validation\Validatable;
|
||||
|
||||
interface ChainedValidator extends Validatable
|
||||
{
|
|
@ -7,9 +7,10 @@
|
|||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Respect\Validation;
|
||||
namespace Respect\Validation\Mixins;
|
||||
|
||||
use finfo;
|
||||
use Respect\Validation\Validatable;
|
||||
|
||||
interface StaticValidator
|
||||
{
|
|
@ -17,6 +17,8 @@ use Respect\Validation\Message\Formatter;
|
|||
use Respect\Validation\Message\StandardFormatter;
|
||||
use Respect\Validation\Message\StandardRenderer;
|
||||
use Respect\Validation\Message\Template;
|
||||
use Respect\Validation\Mixins\ChainedValidator;
|
||||
use Respect\Validation\Mixins\StaticValidator;
|
||||
use Respect\Validation\Rules\AbstractRule;
|
||||
use Respect\Validation\Rules\AllOf;
|
||||
|
||||
|
@ -25,6 +27,7 @@ use function current;
|
|||
|
||||
/**
|
||||
* @mixin StaticValidator
|
||||
* @mixin ChainedValidator
|
||||
*/
|
||||
#[ExceptionClass(NestedValidationException::class)]
|
||||
#[Template(
|
||||
|
|
|
@ -12,16 +12,6 @@ parameters:
|
|||
message: '/Instanceof between mixed and SimpleXMLElement will always evaluate to false\./'
|
||||
path: library/Rules/ArrayVal.php
|
||||
|
||||
-
|
||||
# Why: This error is intentional, so PHPunit can test an invalid __callStatic call
|
||||
message: '/Call to an undefined static method Respect\\Validation\\Validator::iDoNotExistSoIShouldThrowException/'
|
||||
path: tests/unit/ValidatorTest.php
|
||||
|
||||
-
|
||||
# Why: StaticValidator is a stub interface that types __callStatic
|
||||
message: '/Call to static method PHPUnit\\Framework\\Assert::assertSame\(\) with Respect\\Validation\\Validator and Respect\\Validation\\ChainedValidator will always evaluate to false./'
|
||||
path: tests/unit/ValidatorTest.php
|
||||
|
||||
-
|
||||
# Why: I don't want to make changes to the code just to make phpstan happy
|
||||
message: '/Parameter #2 \$values of function vsprintf expects array<bool\|float\|int\|string\|null>, array<string, array<bool\|int\|string>\|bool\|float\|int\|string> given./'
|
||||
|
|
|
@ -27,6 +27,8 @@ final class ValidatorTest extends TestCase
|
|||
public function invalidRuleClassShouldThrowComponentException(): void
|
||||
{
|
||||
$this->expectException(ComponentException::class);
|
||||
|
||||
// @phpstan-ignore-next-line
|
||||
Validator::iDoNotExistSoIShouldThrowException();
|
||||
}
|
||||
|
||||
|
@ -35,6 +37,7 @@ final class ValidatorTest extends TestCase
|
|||
{
|
||||
$validator = Validator::create();
|
||||
|
||||
// @phpstan-ignore-next-line
|
||||
self::assertSame($validator, $validator->not($validator->notEmpty()));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue