CheckVat::getVatNumber()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace DMT\VatServiceEu\Request;
4
5
use JMS\Serializer\Annotation as JMS;
6
use Symfony\Component\Validator\Constraints as Assert;
7
8
/**
9
 * Class CheckVat
10
 *
11
 * @JMS\AccessType("public_method")
12
 * @JMS\XmlNamespace(uri="urn:ec.europa.eu:taxud:vies:services:checkVat:types", prefix="ns1")
13
 * @JMS\XmlRoot("checkVat", namespace="urn:ec.europa.eu:taxud:vies:services:checkVat:types")
14
 */
15
class CheckVat implements RequestInterface
16
{
17
    /**
18
     * @Assert\NotBlank(message="countryCode is required")
19
     * @Assert\Regex(pattern="/^[A-Z]{2}$/", message="countryCode is invalid")
20
     *
21
     * @JMS\Type("string")
22
     * @JMS\XmlElement(cdata=false, namespace="urn:ec.europa.eu:taxud:vies:services:checkVat:types")
23
     *
24
     * @var string
25
     */
26
    protected $countryCode;
27
28
    /**
29
     * @Assert\NotBlank(message="vatNumber is required")
30
     * @Assert\Regex(pattern="/^[0-9A-Za-z\+\*\.]{2,12}$/", message="vatNumber is invalid")
31
     *
32
     * @JMS\Type("string")
33
     * @JMS\XmlElement(cdata=false, namespace="urn:ec.europa.eu:taxud:vies:services:checkVat:types")
34
     *
35
     * @var string
36
     */
37
    protected $vatNumber;
38
39
    /**
40
     * @return string
41
     */
42 13
    public function getCountryCode(): ?string
43
    {
44 13
        return $this->countryCode;
45
    }
46
47
    /**
48
     * @param string $countryCode
49
     */
50 1
    public function setCountryCode(string $countryCode): void
51
    {
52 1
        $this->countryCode = $countryCode;
53
    }
54
55
    /**
56
     * @return string
57
     */
58 13
    public function getVatNumber(): ?string
59
    {
60 13
        return $this->vatNumber;
61
    }
62
63
    /**
64
     * @param string $vatNumber
65
     */
66 1
    public function setVatNumber(string $vatNumber): void
67
    {
68 1
        $this->vatNumber = $vatNumber;
69
    }
70
}
71