diff --git a/src/Bundle.php b/src/Bundle.php index 81b968d..5f60269 100644 --- a/src/Bundle.php +++ b/src/Bundle.php @@ -15,7 +15,5 @@ */ class Bundle extends BaseBundle { - protected $name = 'PHPVietValidationBundle'; - } diff --git a/src/Constraints/IdVNValidator.php b/src/Constraints/IdVNValidator.php index a611d29..edf0224 100644 --- a/src/Constraints/IdVNValidator.php +++ b/src/Constraints/IdVNValidator.php @@ -7,9 +7,9 @@ namespace PHPViet\Symfony\Validation\Constraints; -use PHPViet\Validation\Validator as ConcreteValidator; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use PHPViet\Validation\Validator as ConcreteValidator; use Symfony\Component\Validator\Exception\UnexpectedTypeException; /** @@ -18,13 +18,12 @@ */ class IdVNValidator extends ConstraintValidator { - /** * {@inheritdoc} */ public function validate($value, Constraint $constraint): void { - if (!$constraint instanceof IdVN) { + if (! $constraint instanceof IdVN) { throw new UnexpectedTypeException($constraint, IdVN::class); } @@ -35,5 +34,4 @@ public function validate($value, Constraint $constraint): void ->addViolation(); } } - } diff --git a/src/Constraints/IpVNValidator.php b/src/Constraints/IpVNValidator.php index 5b58130..600754b 100644 --- a/src/Constraints/IpVNValidator.php +++ b/src/Constraints/IpVNValidator.php @@ -7,9 +7,9 @@ namespace PHPViet\Symfony\Validation\Constraints; -use PHPViet\Validation\Validator as ConcreteValidator; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use PHPViet\Validation\Validator as ConcreteValidator; use Symfony\Component\Validator\Exception\UnexpectedTypeException; /** @@ -18,13 +18,12 @@ */ class IpVNValidator extends ConstraintValidator { - /** * {@inheritdoc} */ public function validate($value, Constraint $constraint): void { - if (!$constraint instanceof IpVN) { + if (! $constraint instanceof IpVN) { throw new UnexpectedTypeException($constraint, IpVN::class); } @@ -47,5 +46,4 @@ protected function getCode(?int $ipVersion): string return IpVN::IP_VN_ERROR; } } - } diff --git a/src/Constraints/LandLineVNValidator.php b/src/Constraints/LandLineVNValidator.php index 0cbf5b3..33e2a4d 100644 --- a/src/Constraints/LandLineVNValidator.php +++ b/src/Constraints/LandLineVNValidator.php @@ -7,9 +7,9 @@ namespace PHPViet\Symfony\Validation\Constraints; -use PHPViet\Validation\Validator as ConcreteValidator; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use PHPViet\Validation\Validator as ConcreteValidator; use Symfony\Component\Validator\Exception\UnexpectedTypeException; /** @@ -18,13 +18,12 @@ */ class LandLineVNValidator extends ConstraintValidator { - /** * {@inheritdoc} */ public function validate($value, Constraint $constraint): void { - if (!$constraint instanceof LandLineVN) { + if (! $constraint instanceof LandLineVN) { throw new UnexpectedTypeException($constraint, LandLineVN::class); } @@ -35,5 +34,4 @@ public function validate($value, Constraint $constraint): void ->addViolation(); } } - } diff --git a/src/Constraints/MobileVNValidator.php b/src/Constraints/MobileVNValidator.php index 3d0b68b..f5fb352 100644 --- a/src/Constraints/MobileVNValidator.php +++ b/src/Constraints/MobileVNValidator.php @@ -7,9 +7,9 @@ namespace PHPViet\Symfony\Validation\Constraints; -use PHPViet\Validation\Validator as ConcreteValidator; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; +use PHPViet\Validation\Validator as ConcreteValidator; use Symfony\Component\Validator\Exception\UnexpectedTypeException; /** @@ -18,13 +18,12 @@ */ class MobileVNValidator extends ConstraintValidator { - /** * {@inheritdoc} */ public function validate($value, Constraint $constraint): void { - if (!$constraint instanceof MobileVN) { + if (! $constraint instanceof MobileVN) { throw new UnexpectedTypeException($constraint, MobileVN::class); } @@ -35,5 +34,4 @@ public function validate($value, Constraint $constraint): void ->addViolation(); } } - } diff --git a/tests/Constraints/IdVNTest.php b/tests/Constraints/IdVNTest.php index ffe6fd1..843f54e 100644 --- a/tests/Constraints/IdVNTest.php +++ b/tests/Constraints/IdVNTest.php @@ -16,7 +16,6 @@ */ class IdVNTest extends TestCase { - public function testValid() { $this->context->expects($this->never())->method('buildViolation'); @@ -37,6 +36,4 @@ protected function getValidatorClass(): string { return IdVNValidator::class; } - - } diff --git a/tests/Constraints/IpVNTest.php b/tests/Constraints/IpVNTest.php index 0fad93d..32d7dba 100644 --- a/tests/Constraints/IpVNTest.php +++ b/tests/Constraints/IpVNTest.php @@ -16,7 +16,6 @@ */ class IpVNTest extends TestCase { - public function testValid(): void { $this->context->expects($this->never())->method('buildViolation'); diff --git a/tests/Constraints/LandLineVNTest.php b/tests/Constraints/LandLineVNTest.php index 511df46..c88b4bd 100644 --- a/tests/Constraints/LandLineVNTest.php +++ b/tests/Constraints/LandLineVNTest.php @@ -36,5 +36,4 @@ protected function getValidatorClass(): string { return LandLineVNValidator::class; } - } diff --git a/tests/Constraints/MobileVNTest.php b/tests/Constraints/MobileVNTest.php index 4d5252b..831e863 100644 --- a/tests/Constraints/MobileVNTest.php +++ b/tests/Constraints/MobileVNTest.php @@ -16,7 +16,6 @@ */ class MobileVNTest extends TestCase { - public function testValid() { $this->context->expects($this->never())->method('buildViolation'); @@ -37,5 +36,4 @@ protected function getValidatorClass(): string { return MobileVNValidator::class; } - } diff --git a/tests/Constraints/TestCase.php b/tests/Constraints/TestCase.php index 227a36f..dc84c58 100644 --- a/tests/Constraints/TestCase.php +++ b/tests/Constraints/TestCase.php @@ -15,7 +15,6 @@ */ abstract class TestCase extends BaseTestCase { - /** * @var \Symfony\Component\Validator\Context\ExecutionContextInterface|\PHPUnit_Framework_MockObject_MockObject */ @@ -46,5 +45,4 @@ protected function getConstraintsViolationBuilder() } abstract protected function getValidatorClass(): string; - }