Sample   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 5
eloc 18
dl 0
loc 32
ccs 0
cts 16
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A byCities() 0 11 2
A __construct() 0 3 1
A byCountries() 0 11 2
1
<?php
2
3
namespace PierInfor\GeoLite;
4
5
class Sample extends Ip
6
{
7
    
8
    public function __construct($locales = ['fr'])
9
    {
10
        parent::__construct($locales);
11
    }
12
13
    public function byCities(int $colSort = 1): Ip
14
    {
15
        try {
16
            $this
17
                ->setAdapter(self::ADAPTER_COUNTRY)
18
                ->process()
19
                ->sort($colSort);
20
        } catch (\Exception $e) {
21
            echo $e->getMessage();
22
        }
23
        return $this;
24
    }
25
26
    public function byCountries(int $colSort = 1): Ip
27
    {
28
        try {
29
            $this
30
                ->setAdapter(self::ADAPTER_CITY)
31
                ->process()
32
                ->sort($colSort);
33
        } catch (\Exception $e) {
34
            echo $e->getMessage();
35
        }
36
        return $this;
37
    }
38
}
39