Geolocalizable::near()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 2
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