|
@@ -1,6 +1,6 @@
|
|
<?php
|
|
<?php
|
|
|
|
|
|
-namespace ValidatorsBundle\Validator;
|
|
|
|
|
|
+namespace ValidatorsBundle\Validator\Constraints;
|
|
|
|
|
|
use Symfony\Component\Validator\Constraint;
|
|
use Symfony\Component\Validator\Constraint;
|
|
use Symfony\Component\Validator\ConstraintValidator;
|
|
use Symfony\Component\Validator\ConstraintValidator;
|
|
@@ -9,11 +9,6 @@ use WebserviceBundle\Services\Webservice;
|
|
class DeviceValidator extends ConstraintValidator
|
|
class DeviceValidator extends ConstraintValidator
|
|
{
|
|
{
|
|
|
|
|
|
- /**
|
|
|
|
- * @var string
|
|
|
|
- */
|
|
|
|
- private $message = 'error.device_create';
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* @var string
|
|
* @var string
|
|
*/
|
|
*/
|
|
@@ -44,7 +39,7 @@ class DeviceValidator extends ConstraintValidator
|
|
$result = $this->webservice->makeGetRequest($this->deviceCheckUrl);
|
|
$result = $this->webservice->makeGetRequest($this->deviceCheckUrl);
|
|
$data = json_decode($result, true);
|
|
$data = json_decode($result, true);
|
|
if ($data['result'] == false) {
|
|
if ($data['result'] == false) {
|
|
- $this->context->buildViolation($constraint->message ? $constraint->message : $this->message)
|
|
|
|
|
|
+ $this->context->buildViolation($constraint->message)
|
|
->addViolation();
|
|
->addViolation();
|
|
}
|
|
}
|
|
}
|
|
}
|