Circle::setCenter()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 4
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
/*
4
 * This file is part of the Ivory Google Map package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ivory\GoogleMap\Overlay;
13
14
use Ivory\GoogleMap\Base\Coordinate;
15
use Ivory\GoogleMap\Utility\OptionsAwareInterface;
16
use Ivory\GoogleMap\Utility\OptionsAwareTrait;
17
use Ivory\GoogleMap\Utility\VariableAwareTrait;
18
19
/**
20
 * @see http://code.google.com/apis/maps/documentation/javascript/reference.html#Circle
21
 *
22
 * @author GeLo <[email protected]>
23
 */
24 View Code Duplication
class Circle implements ExtendableInterface, OptionsAwareInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
25
{
26
    use OptionsAwareTrait;
27
    use VariableAwareTrait;
28
29
    /**
30
     * @var Coordinate
31
     */
32
    private $center;
33
34
    /**
35
     * @var float
36
     */
37
    private $radius;
38
39
    /**
40
     * @param float   $radius
41
     * @param mixed[] $options
42
     */
43 32
    public function __construct(Coordinate $center, $radius = 1.0, array $options = [])
44
    {
45 32
        $this->setCenter($center);
46 32
        $this->setRadius($radius);
47 32
        $this->addOptions($options);
48 32
    }
49
50
    /**
51
     * @return Coordinate
52
     */
53 20
    public function getCenter()
54
    {
55 20
        return $this->center;
56
    }
57
58 32
    public function setCenter(Coordinate $center)
59
    {
60 32
        $this->center = $center;
61 32
    }
62
63
    /**
64
     * @return float
65
     */
66 16
    public function getRadius()
67
    {
68 16
        return $this->radius;
69
    }
70
71
    /**
72
     * @param float $radius
73
     */
74 32
    public function setRadius($radius)
75
    {
76 32
        $this->radius = $radius;
77 32
    }
78
}
79