File tree Expand file tree Collapse file tree 1 file changed +42
-0
lines changed
Expand file tree Collapse file tree 1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ /**
6+ * This file is part of CodeIgniter 4 framework.
7+ *
8+ * (c) CodeIgniter Foundation <admin@codeigniter.com>
9+ *
10+ * For the full copyright and license information, please view
11+ * the LICENSE file that was distributed with this source code.
12+ */
13+
14+ namespace CodeIgniter \Debug ;
15+
16+ use CodeIgniter \Test \Utilities \NativeHeadersStack ;
17+
18+ /**
19+ * Mock implementation of the native PHP `headers_sent()` function.
20+ *
21+ * Instead of checking the actual PHP output buffer, this function
22+ * checks the static property in NativeHeadersStack.
23+ *
24+ * @return bool True if headers are considered sent, false otherwise.
25+ */
26+ function headers_sent (): bool
27+ {
28+ return NativeHeadersStack::headersSent ();
29+ }
30+
31+ /**
32+ * Mock implementation of the native PHP `headers_list()` function.
33+ *
34+ * Retrieves the array of headers stored in the NativeHeadersStack class
35+ * rather than the actual headers sent by the server.
36+ *
37+ * @return array The list of simulated headers.
38+ */
39+ function headers_list (): array
40+ {
41+ return NativeHeadersStack::listHeaders ();
42+ }
You can’t perform that action at this time.
0 commit comments