@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | public function validate($value, Constraint $constraint) |
| 37 | 37 | { |
| 38 | - if (!isset($value) || $value === null || !strlen(trim($value))) { |
|
| 38 | + if (!isset($value) || $value === null || !strlen(trim($value))) { |
|
| 39 | 39 | return; |
| 40 | 40 | } |
| 41 | 41 | if (!self::checkLength($value)) { |
@@ -53,9 +53,9 @@ discard block |
||
| 53 | 53 | for ($i = 0; $i < $a; $i++) { |
| 54 | 54 | if ($postal[$i] != '"') { |
| 55 | 55 | if (is_numeric($postal[$i])) { |
| 56 | - $exp .= '[0-'. $postal[$i].']{1}'; |
|
| 56 | + $exp .= '[0-'.$postal[$i].']{1}'; |
|
| 57 | 57 | } else if ($postal[$i] == ' ') { |
| 58 | - $exp .= "\\". $postal[$i]; |
|
| 58 | + $exp .= "\\".$postal[$i]; |
|
| 59 | 59 | } else { |
| 60 | 60 | $exp .= $postal[$i]; |
| 61 | 61 | } |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | |
| 16 | 16 | public function validatedBy() |
| 17 | 17 | { |
| 18 | - return get_class($this) . 'Validator'; |
|
| 18 | + return get_class($this).'Validator'; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | } |
@@ -28,10 +28,10 @@ |
||
| 28 | 28 | |
| 29 | 29 | public function validate($value, Constraint $constraint) |
| 30 | 30 | { |
| 31 | - if (! isset($value) || $value === null || ! strlen(trim($value))) { |
|
| 31 | + if (!isset($value) || $value === null || !strlen(trim($value))) { |
|
| 32 | 32 | return; |
| 33 | 33 | } |
| 34 | - if (! self::isUsernameValid($value)) { |
|
| 34 | + if (!self::isUsernameValid($value)) { |
|
| 35 | 35 | $this->context->addViolation($constraint->message); |
| 36 | 36 | } |
| 37 | 37 | } |
@@ -46,8 +46,8 @@ |
||
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | public function idCardValidate(ExecutionContextInterface $validator, |
| 49 | - Constraint $constraint, |
|
| 50 | - IdCardInterface $idCard) |
|
| 49 | + Constraint $constraint, |
|
| 50 | + IdCardInterface $idCard) |
|
| 51 | 51 | { |
| 52 | 52 | $event = new IdCardValidateEvent($validator, $constraint, $idCard); |
| 53 | 53 | $this->dispatcher->dispatch(ValidationEvents::ID_CARD_VALIDATE, $event); |
@@ -8,7 +8,6 @@ |
||
| 8 | 8 | use LoginCidadao\CoreBundle\Entity\State; |
| 9 | 9 | use LoginCidadao\CoreBundle\Model\IdCardInterface; |
| 10 | 10 | use LoginCidadao\CoreBundle\Entity\IdCard; |
| 11 | -use LoginCidadao\ValidationControlBundle\Validator\Constraints\IdCardValidator; |
|
| 12 | 11 | use Symfony\Component\Validator\Constraint; |
| 13 | 12 | use LoginCidadao\ValidationControlBundle\Event\IdCardValidateEvent; |
| 14 | 13 | use Symfony\Component\Validator\ExecutionContextInterface; |
@@ -22,8 +22,8 @@ |
||
| 22 | 22 | protected function getCurrentData() |
| 23 | 23 | { |
| 24 | 24 | return $this->handler->allIdOffset($this->getPerIteration(), |
| 25 | - $this->getOffset(), |
|
| 26 | - $this->client); |
|
| 25 | + $this->getOffset(), |
|
| 26 | + $this->client); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | } |
@@ -24,8 +24,8 @@ |
||
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | protected function assertJsonResponse($response, $statusCode = 200, |
| 27 | - $checkValidJson = true, |
|
| 28 | - $contentType = 'application/json') |
|
| 27 | + $checkValidJson = true, |
|
| 28 | + $contentType = 'application/json') |
|
| 29 | 29 | { |
| 30 | 30 | $this->assertEquals( |
| 31 | 31 | $statusCode, $response->getStatusCode(), $response->getContent() |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | |
| 16 | 16 | public function validatedBy() |
| 17 | 17 | { |
| 18 | - return get_class($this) . 'Validator'; |
|
| 18 | + return get_class($this).'Validator'; |
|
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | } |
@@ -2,10 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace LoginCidadao\APIBundle\Controller; |
| 4 | 4 | |
| 5 | -use FOS\RestBundle\Util\Codes; |
|
| 6 | 5 | use Nelmio\ApiDocBundle\Annotation\ApiDoc; |
| 7 | 6 | use Symfony\Component\HttpFoundation\Request; |
| 8 | -use FOS\RestBundle\Request\ParamFetcherInterface; |
|
| 9 | 7 | use FOS\RestBundle\Controller\Annotations as REST; |
| 10 | 8 | use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; |
| 11 | 9 | use LoginCidadao\APIBundle\Security\Audit\Annotation as Audit; |
@@ -9,7 +9,6 @@ |
||
| 9 | 9 | use JMS\Serializer\Annotation as JMS; |
| 10 | 10 | use LoginCidadao\CoreBundle\Model\IdCardInterface; |
| 11 | 11 | use LoginCidadao\CoreBundle\Model\PersonInterface; |
| 12 | - |
|
| 13 | 12 | use LoginCidadao\ValidationControlBundle\Validator\Constraints as Validators; |
| 14 | 13 | |
| 15 | 14 | /** |