Skip to content

Commit 1920222

Browse files
committed
Fix CacheProvider
1 parent 6a8a65d commit 1920222

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

Provider/CacheProvider.php

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
namespace Bazinga\Bundle\GeocoderBundle\Provider;
1212

13+
use Geocoder\Geocoder;
1314
use Geocoder\Provider\ProviderInterface;
1415
use Doctrine\Common\Cache\Cache;
1516

@@ -19,12 +20,12 @@
1920
class CacheProvider implements ProviderInterface
2021
{
2122
/**
22-
* @var \Doctrine\Common\Cache\Cache
23+
* @var Cache
2324
*/
2425
private $cache;
2526

2627
/**
27-
* @var \Geocoder\Provider\ProviderInterface
28+
* @var ProviderInterface
2829
*/
2930
private $provider;
3031

@@ -38,6 +39,11 @@ class CacheProvider implements ProviderInterface
3839
*/
3940
private $locale;
4041

42+
/**
43+
* @var integer
44+
*/
45+
private $maxResults = Geocoder::MAX_RESULTS;
46+
4147
/**
4248
* Constructor
4349
*
@@ -48,10 +54,10 @@ class CacheProvider implements ProviderInterface
4854
*/
4955
public function __construct(Cache $cache, ProviderInterface $provider, $lifetime = 0, $locale = null)
5056
{
51-
$this->cache = $cache;
57+
$this->cache = $cache;
5258
$this->provider = $provider;
5359
$this->lifetime = $lifetime;
54-
$this->locale = $locale;
60+
$this->locale = $locale;
5561
}
5662

5763
/**
@@ -95,4 +101,14 @@ public function getName()
95101
{
96102
return 'cache';
97103
}
104+
105+
/**
106+
* {@inheritDoc}
107+
*/
108+
public function setMaxResults($maxResults)
109+
{
110+
$this->maxResults = $maxResults;
111+
112+
return $this;
113+
}
98114
}

0 commit comments

Comments
 (0)