Completed
Push — dev ( c60fc1...b755db )
by Zach
02:02
created

helpers.php ➔ dd()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 6
nc 1
nop 0
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
use Phalcon\Debug\Dump;
4
5
if (!function_exists('dd')) {
6
    /**
7
     * Dump the passed variables and end the script.
8
     *
9
     * @param  mixed
10
     */
11
    function dd()
12
    {
13
        array_map(function ($x) {
14
            $string = (new Dump(null, true))->variable($x);
15
16
            echo PHP_SAPI == 'cli' ? strip_tags($string).PHP_EOL : $string;
17
        }, func_get_args());
18
19
        die(1);
1 ignored issue
show
Coding Style Compatibility introduced by
The function dd() contains an exit expression.

An exit expression should only be used in rare cases. For example, if you write a short command line script.

In most cases however, using an exit expression makes the code untestable and often causes incompatibilities with other libraries. Thus, unless you are absolutely sure it is required here, we recommend to refactor your code to avoid its usage.

Loading history...
20
    }
21
}
22