Geolocalizable   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 3
dl 0
loc 21
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A coordinate() 0 4 1
A near() 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
namespace Cubiche\Domain\Geolocation\Selector;
12
13
use Cubiche\Core\Selector\This;
14
use Cubiche\Core\Selector\Property;
15
use Cubiche\Domain\Geolocation\Specification\Constraint\Near;
16
use Cubiche\Domain\Geolocation\Coordinate;
17
use Cubiche\Domain\Geolocation\Distance;
18
19
/**
20
 * Geolocalizable Selector Class.
21
 *
22
 * @author Karel Osorio Ramírez <[email protected]>
23
 */
24
class Geolocalizable extends This
25
{
26
    /**
27
     * @return \Cubiche\Core\Selector\SelectorInterface
28
     */
29
    public function coordinate()
30
    {
31
        return $this->select(new Property('coordinate'));
32
    }
33
34
    /**
35
     * @param Coordinate $coordinate
36
     * @param Distance   $radius
37
     *
38
     * @return \Cubiche\Domain\Geolocation\Specification\Constraint\Near
39
     */
40
    public function near(Coordinate $coordinate, Distance $radius = null)
41
    {
42
        return new Near($this, $coordinate, $radius);
43
    }
44
}
45