Location::setLocation()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
namespace Dwr\GlobalWeatherBundle\Entity;
3
4
class Location
5
{
6
    private $location;
7
    private $city;
8
    private $country;
9
10
    public function setLocation($location)
11
    {
12
        $this->location = $location;
13
        list($this->country, $this->city) = explode(',', $location);
14
15
        return $this;
16
    }
17
18
    public function getLocation()
19
    {
20
        return $this->location;
21
    }
22
23
    public function getCountry()
24
    {
25
        return trim($this->country);
26
    }
27
28
    public function getCity()
29
    {
30
        return trim($this->city);
31
    }
32
}
33