mirror of
https://github.com/Respect/Validation.git
synced 2024-05-16 21:26:40 +02:00
Apply "phpstan/phpstan-deprecation-rules" rules
Signed-off-by: Henrique Moody <henriquemoody@gmail.com>
This commit is contained in:
parent
d00ed89f3c
commit
95b499b627
|
@ -25,6 +25,7 @@
|
|||
"malukenho/docheader": "^0.1.4",
|
||||
"mikey179/vfsstream": "^1.6",
|
||||
"phpstan/phpstan": "^0.11",
|
||||
"phpstan/phpstan-deprecation-rules": "^0.11.0",
|
||||
"phpstan/phpstan-phpunit": "^0.11.0",
|
||||
"phpunit/phpunit": "^7.3",
|
||||
"slevomat/coding-standard": "^5.0",
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
includes:
|
||||
- vendor/phpstan/phpstan-deprecation-rules/rules.neon
|
||||
- vendor/phpstan/phpstan-phpunit/extension.neon
|
||||
- vendor/phpstan/phpstan-phpunit/rules.neon
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ namespace Respect\Validation\Rules;
|
|||
|
||||
use Respect\Validation\Test\TestCase;
|
||||
use Respect\Validation\Validatable;
|
||||
use function array_intersect_key;
|
||||
|
||||
/**
|
||||
* @test core
|
||||
|
@ -78,6 +79,6 @@ final class AbstractEnvelopeTest extends TestCase
|
|||
|
||||
$exception = $rule->reportError($input);
|
||||
|
||||
self::assertArraySubset($parameters, $exception->getParams());
|
||||
self::assertEquals($parameters, array_intersect_key($parameters, $exception->getParams()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,18 +27,6 @@ use Respect\Validation\Validatable;
|
|||
*/
|
||||
final class AbstractWrapperTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function shouldReturnDefinedValidatable(): void
|
||||
{
|
||||
$validatable = $this->createMock(Validatable::class);
|
||||
|
||||
$wrapper = $this->getMockForAbstractClass(AbstractWrapper::class, [$validatable]);
|
||||
|
||||
self::assertAttributeSame($validatable, 'validatable', $wrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
|
|
|
@ -27,29 +27,6 @@ use stdClass;
|
|||
*/
|
||||
final class KeySetTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function shouldAcceptKeyRule(): void
|
||||
{
|
||||
$key = new Key('foo', new AlwaysValid(), false);
|
||||
$keySet = new KeySet($key);
|
||||
|
||||
self::assertAttributeSame([$key], 'keyRules', $keySet);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function shouldAcceptAllOfWithOneKeyRule(): void
|
||||
{
|
||||
$key = new Key('foo', new AlwaysValid(), false);
|
||||
$allOf = new AllOf($key);
|
||||
$keySet = new KeySet($allOf);
|
||||
|
||||
self::assertAttributeSame([$key], 'keyRules', $keySet);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*
|
||||
|
@ -92,19 +69,6 @@ final class KeySetTest extends TestCase
|
|||
new KeySet($alwaysValid);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function shouldReturnKeys(): void
|
||||
{
|
||||
$key1 = new Key('foo', new AlwaysValid(), true);
|
||||
$key2 = new Key('bar', new AlwaysValid(), false);
|
||||
|
||||
$keySet = new KeySet($key1, $key2);
|
||||
|
||||
self::assertAttributeSame(['foo', 'bar'], 'keys', $keySet);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
|
|
|
@ -19,7 +19,6 @@ use Symfony\Component\Validator\Constraints\IsFalse;
|
|||
use Symfony\Component\Validator\Constraints\IsNull;
|
||||
use Symfony\Component\Validator\Validation;
|
||||
use Symfony\Component\Validator\Validator\TraceableValidator;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
use function class_exists;
|
||||
|
||||
/**
|
||||
|
@ -53,16 +52,6 @@ final class SfTest extends TestCase
|
|||
self::assertFalse($sut->validate(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function itShouldHaveTheValidatorByDefault(): void
|
||||
{
|
||||
$sut = new Sf(new IsNull());
|
||||
|
||||
self::assertAttributeInstanceOf(ValidatorInterface::class, 'validator', $sut);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
|
|
|
@ -14,7 +14,6 @@ declare(strict_types=1);
|
|||
namespace Respect\Validation\Rules;
|
||||
|
||||
use Respect\Validation\Test\RuleTestCase;
|
||||
use Respect\Validation\Validatable;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
|
@ -64,17 +63,6 @@ final class VatinTest extends RuleTestCase
|
|||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function shouldAcceptCountryCodeOnConstructor(): void
|
||||
{
|
||||
$countryCode = 'PL';
|
||||
$rule = new Vatin($countryCode);
|
||||
|
||||
self::assertAttributeInstanceOf(Validatable::class, 'validatable', $rule);
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \Respect\Validation\Exceptions\ComponentException
|
||||
* @expectedExceptionMessage "BR" is not a supported country code
|
||||
|
|
Loading…
Reference in a new issue