Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
94.44% covered (success)
94.44%
17 / 18
90.00% covered (success)
90.00%
9 / 10
CRAP
0.00% covered (danger)
0.00%
0 / 1
Info
94.44% covered (success)
94.44%
17 / 18
90.00% covered (success)
90.00%
9 / 10
10.02
0.00% covered (danger)
0.00%
0 / 1
 __construct
100.00% covered (success)
100.00%
9 / 9
100.00% covered (success)
100.00%
1 / 1
1
 getCoordinates
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getAsn
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getOrganization
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getCountryNames
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getLocation
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getIsp
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getConnectionType
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getUserType
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getProxyType
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace MediaWiki\IPInfo\Info;
4
5class Info {
6    /** @var Coordinates|null */
7    private $coordinates;
8
9    /** @var int|null */
10    private $asn;
11
12    /** @var string|null */
13    private $organization;
14
15    /** @var array|null */
16    private $countryNames;
17
18    /** @var array|null */
19    private $location;
20
21    /** @var string|null */
22    private $isp;
23
24    /** @var string|null */
25    private $connectionType;
26
27    /** @var string|null */
28    private $userType;
29
30    /** @var ProxyType|null */
31    private $proxyType;
32
33    /**
34     * @param Coordinates|null $coordinates
35     * @param int|null $asn
36     * @param string|null $organization
37     * @param array|null $countryNames
38     * @param Location[]|null $location
39     * @param string|null $isp
40     * @param string|null $connectionType
41     * @param string|null $userType
42     * @param ProxyType|null $proxyType
43     */
44    public function __construct(
45        ?Coordinates $coordinates = null,
46        ?int $asn = null,
47        ?string $organization = null,
48        ?array $countryNames = null,
49        ?array $location = null,
50        ?string $isp = null,
51        ?string $connectionType = null,
52        ?string $userType = null,
53        ?ProxyType $proxyType = null
54    ) {
55        $this->coordinates = $coordinates;
56        $this->asn = $asn;
57        $this->organization = $organization;
58        $this->countryNames = $countryNames;
59        $this->location = $location;
60        $this->isp = $isp;
61        $this->connectionType = $connectionType;
62        $this->userType = $userType;
63        $this->proxyType = $proxyType;
64    }
65
66    /**
67     * @return Coordinates|null
68     */
69    public function getCoordinates(): ?Coordinates {
70        return $this->coordinates;
71    }
72
73    /**
74     * @return int|null
75     */
76    public function getAsn(): ?int {
77        return $this->asn;
78    }
79
80    /**
81     * @return string|null
82     */
83    public function getOrganization(): ?string {
84        return $this->organization;
85    }
86
87    /**
88     * @return array|null
89     */
90    public function getCountryNames(): ?array {
91        return $this->countryNames;
92    }
93
94    /**
95     * @return Location[]|null
96     */
97    public function getLocation(): ?array {
98        return $this->location;
99    }
100
101    /**
102     * @return string|null
103     */
104    public function getIsp(): ?string {
105        return $this->isp;
106    }
107
108    /**
109     * @return string|null
110     */
111    public function getConnectionType(): ?string {
112        return $this->connectionType;
113    }
114
115    /**
116     * @return string|null
117     */
118    public function getUserType(): ?string {
119        return $this->userType;
120    }
121
122    /**
123     * @return ProxyType|null
124     */
125    public function getProxyType(): ?ProxyType {
126        return $this->proxyType;
127    }
128}