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