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

Exception::noCoordinatesFoundforAddress()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 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