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 <dev@noladev.com>
8 * @copyright  Copyright (c) 2009-2027 NOLA Interactive, LLC.
9 * @license    https://www.popphp.org/license     New BSD License
10 */
11
12/**
13 * @namespace
14 */
15namespace Pop\Utils;
16
17use Psr\Log\LoggerInterface;
18
19/**
20 * Pop utils debugger handler interface
21 *
22 * @category   Pop
23 * @package    Pop\Utils
24 * @author     Nick Sagona, III <dev@noladev.com>
25 * @copyright  Copyright (c) 2009-2027 NOLA Interactive, LLC.
26 * @license    https://www.popphp.org/license     New BSD License
27 * @version    3.0.0
28 */
29interface DebuggerHandlerInterface
30{
31
32    /**
33     * Set name
34     *
35     * @param  string $name
36     * @return DebuggerHandlerInterface
37     */
38    public function setName(string $name): DebuggerHandlerInterface;
39
40    /**
41     * Get name
42     *
43     * @return ?string
44     */
45    public function getName(): ?string;
46
47    /**
48     * Has name
49     *
50     * @return bool
51     */
52    public function hasName(): bool;
53
54    /**
55     * Set data
56     *
57     * @param  array $data
58     * @return DebuggerHandlerInterface
59     */
60    public function setData(array $data = []): DebuggerHandlerInterface;
61
62    /**
63     * Get data
64     *
65     * @return array
66     */
67    public function getData(): array;
68
69    /**
70     * Has data
71     *
72     * @return bool
73     */
74    public function hasData(): bool;
75
76    /**
77     * Start
78     *
79     * @return DebuggerHandlerInterface
80     */
81    public function start(): DebuggerHandlerInterface;
82
83    /**
84     * Stop
85     *
86     * @return DebuggerHandlerInterface
87     */
88    public function stop(): DebuggerHandlerInterface;
89
90    /**
91     * Set start
92     *
93     * @param  ?float $start
94     * @return DebuggerHandlerInterface
95     */
96    public function setStart(?float $start = null): DebuggerHandlerInterface;
97
98    /**
99     * Get start
100     *
101     * @return ?float
102     */
103    public function getStart(): ?float;
104
105    /**
106     * Has start
107     *
108     * @return bool
109     */
110    public function hasStart(): bool;
111
112    /**
113     * Set end
114     *
115     * @param  ?float $end
116     * @return DebuggerHandlerInterface
117     */
118    public function setEnd(?float $end = null): DebuggerHandlerInterface;
119
120    /**
121     * Get end
122     *
123     * @return ?float
124     */
125    public function getEnd(): ?float;
126
127    /**
128     * Has end
129     *
130     * @return bool
131     */
132    public function hasEnd(): bool;
133
134    /**
135     * Set elapsed
136     *
137     * @param  float $elapsed
138     * @return DebuggerHandlerInterface
139     */
140    public function setElapsed(float $elapsed): DebuggerHandlerInterface;
141
142    /**
143     * Get elapsed
144     *
145     * @return ?float
146     */
147    public function getElapsed(): ?float;
148
149    /**
150     * Has elapsed
151     *
152     * @return bool
153     */
154    public function hasElapsed(): bool;
155
156    /**
157     * Set logger
158     *
159     * @param  LoggerInterface $logger
160     * @return DebuggerHandlerInterface
161     */
162    public function setLogger(LoggerInterface $logger): DebuggerHandlerInterface;
163
164    /**
165     * Get logger
166     *
167     * @return ?LoggerInterface
168     */
169    public function getLogger(): ?LoggerInterface;
170
171    /**
172     * Has logger
173     *
174     * @return bool
175     */
176    public function hasLogger(): bool;
177
178    /**
179     * Set logger
180     *
181     * @param  array $loggingParams
182     * @return DebuggerHandlerInterface
183     */
184    public function setLoggingParams(array $loggingParams): DebuggerHandlerInterface;
185
186    /**
187     * Get logging params
188     *
189     * @return array
190     */
191    public function getLoggingParams(): array;
192
193    /**
194     * Has logging parameters
195     *
196     * @return bool
197     */
198    public function hasLoggingParams(): bool;
199
200    /**
201     * Prepare handler data for storage
202     *
203     * @return array
204     */
205    public function prepare(): array;
206
207    /**
208     * Prepare handler message
209     *
210     * @param  ?array $context
211     * @return string
212     */
213    public function prepareMessage(?array $context = null): string;
214
215    /**
216     * Trigger handle logging
217     *
218     * @return void
219     */
220    public function log(): void;
221
222}