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
2/**
3 * Pop PHP Framework (http://www.popphp.org/)
4 *
5 * @link       https://github.com/popphp/popphp-framework
6 * @author     Nick Sagona, III <dev@nolainteractive.com>
7 * @copyright  Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)
8 * @license    http://www.popphp.org/license     New BSD License
9 */
10
11/**
12 * @namespace
13 */
14namespace Pop\Debug\Storage;
15
16/**
17 * Debug storage interface
18 *
19 * @category   Pop
20 * @package    Pop\Debug
21 * @author     Nick Sagona, III <dev@nolainteractive.com>
22 * @copyright  Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)
23 * @license    http://www.popphp.org/license     New BSD License
24 * @version    2.0.0
25 */
26interface StorageInterface
27{
28
29    /**
30     * Set the storage format
31     *
32     * @param  string $format
33     * @return StorageInterface
34     */
35    public function setFormat(string $format): StorageInterface;
36
37    /**
38     * Determine if the format is PHP
39     *
40     * @return bool
41     */
42    public function isText(): bool;
43
44    /**
45     * Determine if the format is PHP
46     *
47     * @return bool
48     */
49    public function isPhp(): bool;
50
51    /**
52     * Determine if the format is JSON
53     *
54     * @return bool
55     */
56    public function isJson(): bool;
57
58    /**
59     * Get the storage format
60     *
61     * @return ?string
62     */
63    public function getFormat(): ?string;
64
65    /**
66     * Save debug data
67     *
68     * @param  string $id
69     * @param  mixed  $value
70     * @return void
71     */
72    public function save(string $id, mixed $value): void;
73
74    /**
75     * Get debug data by ID
76     *
77     * @param  string $id
78     * @return mixed
79     */
80    public function getById(string $id): mixed;
81
82    /**
83     * Get debug data by type
84     *
85     * @param  string $type
86     * @return mixed
87     */
88    public function getByType(string $type): mixed;
89
90    /**
91     * Determine if debug data exists by ID
92     *
93     * @param  string $id
94     * @return bool
95     */
96    public function has(string $id): bool;
97
98    /**
99     * Delete debug data by ID
100     *
101     * @param  string $id
102     * @return void
103     */
104    public function delete(string $id): void;
105
106    /**
107     * Clear all debug data
108     *
109     * @return void
110     */
111    public function clear(): void;
112
113    /**
114     * Encode the value based on the format
115     *
116     * @param  mixed $value
117     * @return string
118     */
119    public function encodeValue(mixed $value): string;
120
121    /**
122     * Decode the value based on the format
123     *
124     * @param  mixed $value
125     * @return mixed
126     */
127    public function decodeValue(mixed $value): mixed;
128
129}