Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2declare(strict_types=1);
3/**
4 * Pop PHP Framework (https://www.popphp.org/)
5 *
6 * @link       https://github.com/popphp/popphp-framework
7 * @author     Nick Sagona, III <nick@popphp.org>
8 * @copyright  Copyright (c) 2009-2026 Nick Sagona, III
9 * @license    https://www.popphp.org/license     New BSD License
10 */
11
12/**
13 * @namespace
14 */
15namespace Pop\Session;
16
17/**
18 * Session interface
19 *
20 * @category   Pop
21 * @package    Pop\Session
22 * @author     Nick Sagona, III <nick@popphp.org>
23 * @copyright  Copyright (c) 2009-2026 Nick Sagona, III
24 * @license    https://www.popphp.org/license     New BSD License
25 * @version    5.0.0
26 */
27interface SessionInterface
28{
29
30    /**
31     * Destroy the session
32     *
33     * @return void
34     */
35    public function kill(): void;
36
37    /**
38     * Set a time-based value
39     *
40     * @param  string $key
41     * @param  mixed  $value
42     * @param  int    $expire
43     * @return SessionInterface
44     */
45    public function setTimedValue(string $key, mixed $value, int $expire = 300): SessionInterface;
46
47    /**
48     * Set a request-based value
49     *
50     * @param  string $key
51     * @param  mixed  $value
52     * @param  int    $hops
53     * @return SessionInterface
54     */
55    public function setRequestValue(string $key, mixed $value, int $hops = 1): SessionInterface;
56
57    /**
58     * Check request-based and time-based values, removing any that have expired
59     * or exceeded their hop limit
60     *
61     * @return SessionInterface
62     */
63    public function sweep(): SessionInterface;
64
65}