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