1 | <?php |
||
5 | final class Ip |
||
6 | { |
||
7 | public const TYPE_HTTP = 'HTTP'; |
||
8 | public const TYPE_HTTPS = 'HTTPS'; |
||
9 | public const TYPE_SOCKS4 = 'SOCKS4'; |
||
10 | public const TYPE_SOCKS5 = 'SOCKS5'; |
||
11 | |||
12 | public const ANONIMITY_HIGH = 'high'; |
||
13 | public const ANONIMITY_MEDIUM = 'medium'; |
||
14 | public const ANONIMITY_LOW = 'low'; |
||
15 | public const ANONIMITY_NO = 'no'; |
||
16 | |||
17 | public static $anonimityValues = [ |
||
18 | // Russian |
||
19 | 'Высокая' => self::ANONIMITY_HIGH, |
||
20 | 'Средняя' => self::ANONIMITY_MEDIUM, |
||
21 | 'Низкая' => self::ANONIMITY_LOW, |
||
22 | 'Нет' => self::ANONIMITY_NO, |
||
23 | |||
24 | // English |
||
25 | 'High' => self::ANONIMITY_HIGH, |
||
26 | 'Medium' => self::ANONIMITY_MEDIUM, |
||
27 | 'Low' => self::ANONIMITY_LOW, |
||
28 | 'No' => self::ANONIMITY_NO, |
||
29 | |||
30 | // Ukrainian |
||
31 | 'Висока' => self::ANONIMITY_HIGH, |
||
32 | 'Середня' => self::ANONIMITY_MEDIUM, |
||
33 | 'Низька' => self::ANONIMITY_LOW, |
||
34 | 'Немає' => self::ANONIMITY_NO, |
||
35 | |||
36 | // Español |
||
37 | 'Alto' => self::ANONIMITY_HIGH, |
||
38 | 'Medio' => self::ANONIMITY_MEDIUM, |
||
39 | 'Bajo' => self::ANONIMITY_LOW, |
||
40 | ]; |
||
41 | |||
42 | /** |
||
43 | * @var string |
||
44 | */ |
||
45 | private $address; |
||
46 | |||
47 | /** |
||
48 | * @var int |
||
49 | */ |
||
50 | private $port; |
||
51 | |||
52 | /** |
||
53 | * @var string |
||
54 | */ |
||
55 | private $country; |
||
56 | |||
57 | /** |
||
58 | * @var null|string |
||
59 | */ |
||
60 | private $city; |
||
61 | |||
62 | /** |
||
63 | * @var int |
||
64 | */ |
||
65 | private $speed; |
||
66 | |||
67 | /** |
||
68 | * @var string |
||
69 | */ |
||
70 | private $type; |
||
71 | |||
72 | /** |
||
73 | * @var string |
||
74 | */ |
||
75 | private $anonimity; |
||
76 | |||
77 | /** |
||
78 | * Ip constructor. |
||
79 | * |
||
80 | * @param string $address |
||
81 | * @param int $port |
||
82 | * @param string $country |
||
83 | * @param null|string $city |
||
84 | * @param int $speed |
||
85 | * @param string $type |
||
86 | * @param string $anonimity |
||
87 | */ |
||
88 | public function __construct( |
||
105 | |||
106 | /** |
||
107 | * @return string |
||
108 | */ |
||
109 | public function getAddress(): string |
||
113 | |||
114 | /** |
||
115 | * @return int |
||
116 | */ |
||
117 | public function getPort(): int |
||
121 | |||
122 | /** |
||
123 | * @return string |
||
124 | */ |
||
125 | public function getCountry(): string |
||
129 | |||
130 | /** |
||
131 | * @return null|string |
||
132 | */ |
||
133 | public function getCity(): ?string |
||
137 | |||
138 | /** |
||
139 | * @return int |
||
140 | */ |
||
141 | public function getSpeed(): int |
||
145 | |||
146 | /** |
||
147 | * @return string |
||
148 | */ |
||
149 | public function getType(): string |
||
153 | |||
154 | /** |
||
155 | * @return string |
||
156 | */ |
||
157 | public function getAnonimity(): string |
||
161 | } |
||
162 |