Skip to content

Commit a322da3

Browse files
committed
Replace cache helper with cache from IOC
1 parent 9ad3068 commit a322da3

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/ProviderAndDumperAggregator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function dump($dumper)
7575
public function geocode($value)
7676
{
7777
$cacheKey = str_slug(strtolower(urlencode($value)));
78-
$this->results = cache()->remember(
78+
$this->results = app('cache')->remember(
7979
"geocoder-{$cacheKey}",
8080
config('geocoder.cache-duraction', 0),
8181
function () use ($value) {
@@ -102,7 +102,7 @@ public function get()
102102
public function reverse($latitude, $longitude)
103103
{
104104
$cacheKey = str_slug(strtolower(urlencode("{$latitude}-{$longitude}")));
105-
$this->results = cache()->remember(
105+
$this->results = app('cache')->remember(
106106
"geocoder-{$cacheKey}",
107107
config('geocoder.cache-duraction', 0),
108108
function () use ($latitude, $longitude) {

tests/Laravel5_3/Providers/GeocoderServiceTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,8 @@ public function testCacheIsUsed()
180180
->get();
181181
$cacheKey = str_slug(strtolower(urlencode('1600 Pennsylvania Ave., Washington, DC USA')));
182182

183-
$this->assertEquals($result, cache("geocoder-{$cacheKey}"));
184-
$this->assertTrue(cache()->has("geocoder-{$cacheKey}"));
183+
$this->assertEquals($result, app('cache')->get("geocoder-{$cacheKey}"));
184+
$this->assertTrue(app('cache')->has("geocoder-{$cacheKey}"));
185185
}
186186

187187
public function testJapaneseCharacterGeocoding()
@@ -192,7 +192,7 @@ public function testJapaneseCharacterGeocoding()
192192
->get();
193193

194194
$this->assertEquals($cacheKey, '108-0075e69db1e4baace983bde6b8afe58cbae6b8afe58d97efbc92e4b881e79baeefbc91efbc96efbc8defbc93');
195-
$this->assertTrue(cache()->has("geocoder-{$cacheKey}"));
195+
$this->assertTrue(app('cache')->has("geocoder-{$cacheKey}"));
196196
}
197197

198198
public function testFailedGeocodingCanBeCaught()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy