ci4
1<?php
2
3declare(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// This helper is autoloaded by CodeIgniter.
15
16if (! function_exists('dd')) {
17if (class_exists(Kint::class)) {
18/**
19* Prints a Kint debug report and exits.
20*
21* @param array $vars
22*
23* @return never
24*
25* @codeCoverageIgnore Can't be tested ... exits
26*/
27function dd(...$vars): void
28{
29// @codeCoverageIgnoreStart
30Kint::$aliases[] = 'dd';
31Kint::dump(...$vars);
32
33exit;
34// @codeCoverageIgnoreEnd
35}
36} else {
37// In case that Kint is not loaded.
38/**
39* dd function
40*
41* @param array $vars
42*
43* @return int
44*/
45function dd(...$vars)
46{
47return 0;
48}
49}
50}
51
52if (! function_exists('d') && ! class_exists(Kint::class)) {
53// In case that Kint is not loaded.
54/**
55* d function
56*
57* @param array $vars
58*
59* @return int
60*/
61function d(...$vars)
62{
63return 0;
64}
65}
66
67if (! function_exists('trace')) {
68if (class_exists(Kint::class)) {
69/**
70* Provides a backtrace to the current execution point, from Kint.
71*/
72/**
73* trace function
74*/
75function trace(): void
76{
77Kint::$aliases[] = 'trace';
78Kint::trace();
79}
80} else {
81// In case that Kint is not loaded.
82/**
83* trace function
84*
85* @return int
86*/
87function trace()
88{
89return 0;
90}
91}
92}
93