| Conditions | 7 |
| Paths | 7 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public static function permissionCheck($codesWithIPs, $code) |
||
| 14 | { |
||
| 15 | //with a code you do not have to be logged in ... |
||
| 16 | if (count($codesWithIPs)) { |
||
| 17 | $ip = EcommerceCountry::get_ip(); |
||
| 18 | if ($code) { |
||
| 19 | $testIP = isset($codesWithIPs[$code]) ? $codesWithIPs[$code] : false; |
||
| 20 | if ($testIP) { |
||
| 21 | if ($testIP === $ip || $testIP === '*') { |
||
| 22 | return true; |
||
| 23 | } |
||
| 24 | } |
||
| 25 | } |
||
| 26 | } |
||
| 27 | return Permission::check('ADMIN'); |
||
| 28 | } |
||
| 29 | } |
||
| 30 |
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.