InvalidArgument   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A queryNotValid() 0 4 1
A localeNotValid() 0 4 1
A emptyQuery() 0 4 1
1
<?php
2
3
namespace Gemz\GeoIp\Exceptions;
4
5
class InvalidArgument extends \Exception
6
{
7
    public static function queryNotValid(string $query): self
8
    {
9
        return new self("The given query `{$query}` is not a valid url or ipv4 or ipv6 address");
10
    }
11
12
    public static function localeNotValid(string $locale): self
13
    {
14
        return new self("The given locale `{$locale}` is not a valid locale");
15
    }
16
17
    public static function emptyQuery()
18
    {
19
        return new self("There is no query. Please provide a query in form of for('domain')");
20
    }
21
}
22