City   A
last analyzed

Complexity

Total Complexity 11

Size/Duplication

Total Lines 64
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 11
eloc 11
c 1
b 0
f 0
dl 0
loc 64
rs 10

11 Methods

Rating   Name   Duplication   Size   Complexity  
A __toString() 0 3 1
A getDepartment() 0 3 1
A getInseeCode() 0 3 1
A getSeLogerNeufCode() 0 3 1
A getRegion() 0 3 1
A getDepartmentCode() 0 3 1
A getZipCode() 0 3 1
A getPapCode() 0 3 1
A __construct() 0 10 1
A getLogicImmoCode() 0 3 1
A getName() 0 3 1
1
<?php
2
3
namespace App\DTO;
4
5
use Stringable;
6
7
class City implements Stringable
8
{
9
    public function __construct(
10
        private string $name,
11
        private string $departmentCode,
12
        private string $department,
13
        private string $region,
14
        private int $inseeCode,
15
        private int $logicImmoCode,
16
        private int $papCode,
17
        private int $seLogerNeufCode
18
    ) {}
19
20
    public function getName(): string
21
    {
22
        return $this->name;
23
    }
24
25
    public function getDepartmentCode(): string
26
    {
27
        return $this->departmentCode;
28
    }
29
30
    public function getDepartment(): string
31
    {
32
        return $this->department;
33
    }
34
35
    public function getRegion(): string
36
    {
37
        return $this->region;
38
    }
39
40
    public function getInseeCode(): int
41
    {
42
        return $this->inseeCode;
43
    }
44
45
    public function getLogicImmoCode(): int
46
    {
47
        return $this->logicImmoCode;
48
    }
49
50
    public function getPapCode(): int
51
    {
52
        return $this->papCode;
53
    }
54
55
    public function getSeLogerNeufCode(): int
56
    {
57
        return $this->seLogerNeufCode;
58
    }
59
60
    public function getZipCode(): string
61
    {
62
        return $this->departmentCode . '000';
63
    }
64
65
    /**
66
     * {@inheritDoc}
67
     */
68
    public function __toString(): string
69
    {
70
        return $this->name;
71
    }
72
}
73