| Conditions | 4 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 4.5923 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 12 | function init_cookie ($cookie = []) { |
|
| 23 | 12 | $this->cookie = $cookie; |
|
| 24 | /** |
||
| 25 | * Fill un-prefixed keys according to system configuration |
||
| 26 | */ |
||
| 27 | 12 | $prefix = Config::instance()->core['cookie_prefix']; |
|
| 28 | 12 | $prefix_length = strlen($prefix); |
|
| 29 | 12 | if ($prefix_length) { |
|
| 30 | foreach ($cookie as $key => $value) { |
||
| 31 | if (strpos($key, $prefix) === 0) { |
||
| 32 | $this->cookie[substr($key, $prefix_length)] = $value; |
||
| 33 | } |
||
| 34 | } |
||
| 35 | } |
||
| 36 | 12 | } |
|
| 37 | /** |
||
| 48 |