| Total Complexity | 4 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 13 | class CustomerVatIdentification extends Constraint |
||
| 14 | { |
||
| 15 | public const VAT_ID_FORMAT_NOT_CORRECT = '463d3548-1caf-11eb-adc1-0242ac120002'; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | public $message = 'The format of vatId {{ vatId }} is not correct.'; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var bool |
||
| 24 | */ |
||
| 25 | public $shouldCheck = true; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var Context |
||
| 29 | */ |
||
| 30 | public $context; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @var string |
||
| 34 | */ |
||
| 35 | protected $countryId; |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @var array |
||
| 39 | */ |
||
| 40 | protected static $errorNames = [ |
||
| 41 | self::VAT_ID_FORMAT_NOT_CORRECT => 'VAT_ID_FORMAT_NOT_CORRECT', |
||
| 42 | ]; |
||
| 43 | |||
| 44 | public function __construct($options = null) |
||
| 45 | { |
||
| 46 | parent::__construct($options); |
||
| 47 | |||
| 48 | if ($this->countryId === null) { |
||
| 49 | throw new MissingOptionsException(sprintf('Option "countryId" must be given for constraint %s', self::class), ['countryId']); |
||
| 50 | } |
||
| 51 | } |
||
| 52 | |||
| 53 | public function getCountryId(): string |
||
| 54 | { |
||
| 55 | return $this->countryId; |
||
| 56 | } |
||
| 57 | |||
| 58 | public function getShouldCheck(): bool |
||
| 61 | } |
||
| 62 | } |
||
| 63 |