Commune   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 7
c 2
b 0
f 2
lcom 0
cbo 0
dl 0
loc 42
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getName() 0 4 1
A setName() 0 4 1
A getZipcode() 0 4 1
A setZipcode() 0 4 1
A getDepartement() 0 4 1
A setDepartement() 0 4 1
1
<?php
2
3
namespace Departements\Model;
4
5
use Departements\Model\Departement;
6
7
class Commune
8
{
9
    protected $name;
10
    protected $zipcode;
11
    protected $departement;
12
13
    function __construct($name, $zipcode, Departement $departement) {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
14
        $this->name        = $name;
15
        $this->zipcode     = $zipcode;
16
        $this->departement = $departement;
17
    }
18
19
    public function getName()
20
    {
21
        return $this->name;
22
    }
23
24
    public function setName($name)
25
    {
26
        $this->name = $name;
27
    }
28
29
    public function getZipcode()
30
    {
31
        return $this->zipcode;
32
    }
33
34
    public function setZipcode($zipcode)
35
    {
36
        $this->zipcode = $zipcode;
37
    }
38
39
    public function getDepartement()
40
    {
41
        return $this->departement;
42
    }
43
44
    public function setDepartement(Departement $departement)
45
    {
46
        $this->departement = $departement;
47
    }
48
}
49
50