| Conditions | 2 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | public function geocode( string $address ) { |
||
| 29 | $key = $this->cache->makeKey( __CLASS__, $address ); |
||
| 30 | |||
| 31 | $coordinates = $this->cache->get( $key ); |
||
| 32 | |||
| 33 | // There was no entry in the cache, so we retrieve the coordinates |
||
| 34 | if ( $coordinates === false ) { |
||
| 35 | $coordinates = $this->geocoder->geocode( $address ); |
||
| 36 | |||
| 37 | $this->cache->set( $key, $coordinates, BagOStuff::TTL_DAY ); |
||
| 38 | } |
||
| 39 | |||
| 40 | return $coordinates; |
||
| 41 | } |
||
| 42 | } |
||
| 43 |