| Conditions | 4 |
| Paths | 4 |
| Total Lines | 11 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 11 | public static function trackVisitedPost(Request $request, $post_id) |
||
| 12 | { |
||
| 13 | $visited_posts = array(); |
||
| 14 | if (isset($post_id)) { |
||
| 15 | if (self::checkCookieConsent()) { |
||
| 16 | if (self::getCookie($request) !== null) { |
||
| 17 | $visited_posts = self::getCookie($request); |
||
| 18 | array_push($visited_posts, $post_id); |
||
| 19 | } else { |
||
| 20 | array_push($visited_posts, $post_id); |
||
| 21 | self::setCookie(json_encode($visited_posts)); |
||
| 22 | } |
||
| 52 |