Completed
Push — master ( 5081da...0415ba )
by
unknown
24:28
created

GeocoderProviderAggregatorAdapter::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php namespace Geocoder\Laravel;
2
3
/**
4
 * This file is part of the GeocoderLaravel library.
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
use Geocoder\ProviderAggregator;
10
11
/**
12
 * @author Mike Bronner <[email protected]>
13
 */
14
class GeocoderProviderAggregatorAdapter
15
{
16
    protected $aggregator;
17
18
    public function __construct(int $limit = Geocoder::DEFAULT_RESULT_LIMIT)
19
    {
20
        $this->aggregator = new ProviderAggregator($limit);
21
    }
22
23
    public function geocodeQuery($query)
24
    {
25
        return $this->aggregator->geocodeQuery($query);
26
    }
27
28
    public function reverseQuery($query)
29
    {
30
        return $this->aggregator->reverseQuery($query);
31
    }
32
33
    public function getName()
34
    {
35
        return $this->aggregator->getName();
36
    }
37
38
    public function geocode($value)
39
    {
40
        return $this->aggregator->geocode($value);
41
    }
42
43
    public function reverse(float $latitude, float $longitude)
44
    {
45
        return $this->aggregator->reverse($latitude, $longitude);
46
    }
47
48
    public function limit($limit)
49
    {
50
        $this->aggregator->limit($limit);
51
52
        return $this;
53
    }
54
55
    public function getLimit()
56
    {
57
        return $this->aggregator->getLimit();
58
    }
59
60
    public function registerProvider($provider)
61
    {
62
        $this->aggregator->registerProvider($provider);
63
64
        return $this;
65
    }
66
67
    public function registerProviders($providers = [])
68
    {
69
        $this->aggregator->registerProviders($providers);
70
71
        return $this;
72
    }
73
74
    public function using($name)
75
    {
76
        $this->aggregator->using($name);
77
78
        return $this;
79
    }
80
81
    public function getProviders()
82
    {
83
        return $this->aggregator->getProviders();
84
    }
85
86
    protected function getProvider()
87
    {
88
        return $this->aggregator->getProvider();
0 ignored issues
show
Bug introduced by
The method getProvider() cannot be called from this context as it is declared protected in class Geocoder\ProviderAggregator.

This check looks for access to methods that are not accessible from the current context.

If you need to make a method accessible to another context you can raise its visibility level in the defining class.

Loading history...
89
    }
90
}
91