Completed
Push — master ( 20655c...87b69d )
by Jeroen
02:06
created

Exception   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 25
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A curlNotInstalled() 0 6 1
A noAddressFoundForCoordinates() 0 7 1
A noCoordinatesFoundforAddress() 0 7 1
1
<?php
2
3
namespace JeroenDesloovere\Geolocation;
4
5
class Exception extends \Exception
6
{
7
    public static function curlNotInstalled(): Exception
8
    {
9
        return new self(
10
            'This method requires cURL (http://php.net/curl), it seems like the extension isn\'t installed.'
11
        );
12
    }
13
14
    public static function noAddressFoundForCoordinates($latitude, $longitude): Exception
15
    {
16
        return new self(
17
            'No address found for coordinates.
18
             With latitude: "' . $latitude . '" and longitude "' . $longitude . '".'
19
        );
20
    }
21
22
    public static function noCoordinatesFoundforAddress(array $addressData): Exception
23
    {
24
        return new self(
25
            'No coordinates found for address.
26
             With address: "' . implode(', ', $addressData) . '".'
27
        );
28
    }
29
}
30