GeolocalizableCriteriaTrait::asGeolocalizable()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 8
rs 9.4285
cc 2
eloc 4
nc 2
nop 0
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\Specification;
12
13
use Cubiche\Domain\Geolocation\Selector\Geolocalizable;
14
15
/**
16
 * Geolocalizable Criteria Trait.
17
 *
18
 * @author Karel Osorio Ramírez <[email protected]>
19
 */
20
trait GeolocalizableCriteriaTrait
21
{
22
    /**
23
     * @var Geolocalizable
24
     */
25
    protected static $geolocalizable = null;
26
27
    /**
28
     * @return \Cubiche\Domain\Geolocation\Selector\Geolocalizable
29
     */
30
    public static function asGeolocalizable()
31
    {
32
        if (self::$geolocalizable === null) {
33
            self::$geolocalizable = new Geolocalizable();
34
        }
35
36
        return self::$geolocalizable;
37
    }
38
}
39