Code Duplication    Length = 64-65 lines in 2 locations

src/Base/Document.php 1 location

@@ 9-73 (lines=65) @@
6
 *
7
 * @author Thiago Paes <[email protected]>
8
 */
9
class Document
10
{
11
    /**
12
     * CPF - for individual
13
     *
14
     * @const int
15
     */
16
    const CPF = 1;
17
18
    /**
19
     * CNPJ - for Legal Entity
20
     *
21
     */
22
    const CNPJ = 2;
23
24
    /**
25
     * @var string
26
     */
27
    private $type = self::CPF;
28
29
    /**
30
     * @var int
31
     */
32
    private $number;
33
34
    /**
35
     * @param int $type
36
     */
37
    public function __construct(int $type = self::CPF)
38
    {
39
        $this->setType($type);
40
    }
41
42
    /**
43
     * @return string
44
     */
45
    public function getType(): int
46
    {
47
        return $this->type;
48
    }
49
50
    /**
51
     * @param string $type
52
     */
53
    public function setType(int $type)
54
    {
55
        $this->type = $type;
56
    }
57
58
    /**
59
     * @return mixed
60
     */
61
    public function getNumber(): int
62
    {
63
        return $this->number;
64
    }
65
66
    /**
67
     * @param mixed $number
68
     */
69
    public function setNumber(int $number)
70
    {
71
        $this->number = $number;
72
    }
73
}
74

src/Base/Phone.php 1 location

@@ 9-72 (lines=64) @@
6
 *
7
 * @author Thiago Paes <[email protected]>
8
 */
9
class Phone
10
{
11
    /**
12
     * @const int
13
     */
14
    const CELLPHONE = 1;
15
16
    /**
17
     * @const int
18
     */
19
    const TELEPHONE = 2;
20
21
    /**
22
     * @var int
23
     */
24
    private $number;
25
26
    /**
27
     * @var int
28
     */
29
    private $type;
30
31
    /**
32
     * Constructor
33
     *
34
     * @param int $type
35
     */
36
    public function __construct(int $type = self::TELEPHONE)
37
    {
38
        $this->setType($type);
39
    }
40
41
    /**
42
     * @return int
43
     */
44
    public function getNumber()
45
    {
46
        return $this->number;
47
    }
48
49
    /**
50
     * @param int $number
51
     */
52
    public function setNumber(int $number)
53
    {
54
        $this->number = $number;
55
    }
56
57
    /**
58
     * @return int
59
     */
60
    public function getType(): int
61
    {
62
        return $this->type;
63
    }
64
65
    /**
66
     * @param int $type
67
     */
68
    public function setType(int $type = self::CELLPHONE)
69
    {
70
        $this->type = $type;
71
    }
72
}
73