GeolocalizableTrait   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
c 0
b 0
f 0
lcom 1
cbo 0
dl 0
loc 31
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A coordinate() 0 4 1
A setCoordinate() 0 4 1
A hasCoordinate() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of the Cubiche package.
5
 *
6
 * Copyright (c) Cubiche
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Cubiche\Domain\Geolocation;
13
14
/**
15
 * Geolocalizable Trait.
16
 *
17
 * @author Karel Osorio Ramírez <[email protected]>
18
 */
19
trait GeolocalizableTrait
20
{
21
    /**
22
     * @var Coordinate
23
     */
24
    protected $coordinate;
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function coordinate()
30
    {
31
        return $this->coordinate;
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function setCoordinate(Coordinate $coordinate)
38
    {
39
        $this->coordinate = $coordinate;
40
    }
41
42
    /**
43
     * @return bool
44
     */
45
    public function hasCoordinate()
46
    {
47
        return $this->coordinate !== null;
48
    }
49
}
50