1 | <?php |
||
15 | class IpAccess extends Object |
||
|
|||
16 | { |
||
17 | /** |
||
18 | * @var array |
||
19 | */ |
||
20 | public $allowedIps = []; |
||
21 | |||
22 | /** |
||
23 | * @config |
||
24 | * |
||
25 | * @var array |
||
26 | */ |
||
27 | private static $allowed_ips = []; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | private $ip = ''; |
||
33 | |||
34 | /** |
||
35 | * IpAccess constructor. |
||
36 | * |
||
37 | * @param string $ip |
||
38 | * @param array $allowedIps |
||
39 | */ |
||
40 | public function __construct($ip = '', $allowedIps = []) |
||
47 | |||
48 | /** |
||
49 | * @param $ip |
||
50 | */ |
||
51 | public function setIp($ip) |
||
55 | |||
56 | /** |
||
57 | * @return array |
||
58 | */ |
||
59 | public function getAllowedIps() |
||
68 | |||
69 | /** |
||
70 | * @return bool |
||
71 | */ |
||
72 | public function isEnabled() |
||
76 | |||
77 | /** |
||
78 | * @return bool |
||
79 | */ |
||
80 | public function hasAccess() |
||
88 | |||
89 | /** |
||
90 | * @return bool |
||
91 | */ |
||
92 | public function matchIp() |
||
96 | |||
97 | /** |
||
98 | * @param Controller $controller |
||
99 | * |
||
100 | * @throws SS_HTTPResponse_Exception |
||
101 | */ |
||
102 | public function respondNoAccess(Controller $controller) |
||
110 | |||
111 | /** |
||
112 | * @return string |
||
113 | */ |
||
114 | public function matchExact() |
||
118 | |||
119 | /** |
||
120 | * Try to match against a ip range |
||
121 | * Example : 192.168.1.50-100. |
||
122 | * |
||
123 | * @return string |
||
124 | */ |
||
125 | public function matchRange() |
||
145 | |||
146 | /** |
||
147 | * Try to match cidr range |
||
148 | * Example : 192.168.1.0/24. |
||
149 | * |
||
150 | * @return string |
||
151 | */ |
||
152 | public function matchCIDR() |
||
169 | |||
170 | /** |
||
171 | * Try to match against a range that ends with a wildcard * |
||
172 | * Example : 192.168.1.* |
||
173 | * Example : 192.168.*. |
||
174 | * |
||
175 | * @return string |
||
176 | */ |
||
177 | public function matchWildCard() |
||
193 | } |
||
194 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.