Skip to content

Apply fixes from StyleCI #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/Bundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,5 @@
*/
class Bundle extends BaseBundle
{

protected $name = 'PHPVietValidationBundle';

}
6 changes: 2 additions & 4 deletions src/Constraints/IdVNValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -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);
}

Expand All @@ -35,5 +34,4 @@ public function validate($value, Constraint $constraint): void
->addViolation();
}
}

}
6 changes: 2 additions & 4 deletions src/Constraints/IpVNValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -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);
}

Expand All @@ -47,5 +46,4 @@ protected function getCode(?int $ipVersion): string
return IpVN::IP_VN_ERROR;
}
}

}
6 changes: 2 additions & 4 deletions src/Constraints/LandLineVNValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -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);
}

Expand All @@ -35,5 +34,4 @@ public function validate($value, Constraint $constraint): void
->addViolation();
}
}

}
6 changes: 2 additions & 4 deletions src/Constraints/MobileVNValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -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);
}

Expand All @@ -35,5 +34,4 @@ public function validate($value, Constraint $constraint): void
->addViolation();
}
}

}
3 changes: 0 additions & 3 deletions tests/Constraints/IdVNTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
class IdVNTest extends TestCase
{

public function testValid()
{
$this->context->expects($this->never())->method('buildViolation');
Expand All @@ -37,6 +36,4 @@ protected function getValidatorClass(): string
{
return IdVNValidator::class;
}


}
1 change: 0 additions & 1 deletion tests/Constraints/IpVNTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
class IpVNTest extends TestCase
{

public function testValid(): void
{
$this->context->expects($this->never())->method('buildViolation');
Expand Down
1 change: 0 additions & 1 deletion tests/Constraints/LandLineVNTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,4 @@ protected function getValidatorClass(): string
{
return LandLineVNValidator::class;
}

}
2 changes: 0 additions & 2 deletions tests/Constraints/MobileVNTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
class MobileVNTest extends TestCase
{

public function testValid()
{
$this->context->expects($this->never())->method('buildViolation');
Expand All @@ -37,5 +36,4 @@ protected function getValidatorClass(): string
{
return MobileVNValidator::class;
}

}
2 changes: 0 additions & 2 deletions tests/Constraints/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
*/
abstract class TestCase extends BaseTestCase
{

/**
* @var \Symfony\Component\Validator\Context\ExecutionContextInterface|\PHPUnit_Framework_MockObject_MockObject
*/
Expand Down Expand Up @@ -46,5 +45,4 @@ protected function getConstraintsViolationBuilder()
}

abstract protected function getValidatorClass(): string;

}