District::getDistrict()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 6
cts 6
cp 1
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 0
crap 2
1
<?php
2
/*
3
 * This file is part of the La Voz Feed Generator package.
4
 *
5
 * (c) Zephia <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Zephia\LaVozFeed\Entity;
12
13
use Zephia\LaVozFeed\Exception\LogicException;
14
15
/**
16
 * Class District
17
 *
18
 * @package Zephia\LaVozFeed\Entity
19
 * @author  Mauro Moreno <[email protected]>
20
 */
21
class District extends Entity
22
{
23
    /**
24
     * @var string
25
     */
26
    private $district;
27
28
    /**
29
     * @var string
30
     */
31
    private $zone;
32
33
    /**
34
     * Get District
35
     *
36
     * @return string
37
     */
38 3
    public function getDistrict()
39
    {
40 3
        if (empty($this->district)) {
41 1
            throw new LogicException(
42 1
                sprintf(self::ERROR_MISSING_ATTRIBUTE_FORMAT, 'district')
43 1
            );
44
        }
45 2
        return $this->district;
46
    }
47
48
    /**
49
     * Get District
50
     *
51
     * @param string $district
52
     *
53
     * @return District
54
     */
55 2
    public function setDistrict($district)
56
    {
57 2
        $this->district = $district;
58 2
        return $this;
59
    }
60
61
    /**
62
     * Get Zone
63
     *
64
     * @return string
65
     */
66 2
    public function getZone()
67
    {
68 2
        return $this->zone;
69
    }
70
71
    /**
72
     * Get Zone
73
     *
74
     * @param string $zone
75
     *
76
     * @return District
77
     */
78 1
    public function setZone($zone)
79
    {
80 1
        $this->zone = $zone;
81 1
        return $this;
82
    }
83
}
84