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