init_helpers.php ➔ d()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
if (!function_exists('d')) {
4
    /**
5
     * Alias of Kint::dump().
6
     *
7
     * @return string
8
     */
9
    function d()
0 ignored issues
show
Coding Style introduced by
This method's name is shorter than the configured minimum length of 3 characters.

Even though PHP does not care about the name of your methods, it is generally a good practice to choose method names which can be easily understood by other human readers.

Loading history...
10
    {
11
        $args = func_get_args();
12
13
        return call_user_func_array(array('Kint', 'dump'), $args);
14
    }
15
16
    Kint::$aliases[] = 'd';
17
}
18
19
if (!function_exists('s')) {
20
    /**
21
     * Alias of Kint::dump(), however the output is in plain text.
22
     *
23
     * Alias of Kint::dump(), however the output is in plain htmlescaped text
24
     * with some minor visibility enhancements added.
25
     *
26
     * If run in CLI mode, output is not escaped.
27
     *
28
     * To force rendering mode without autodetecting anything:
29
     *
30
     * Kint::$enabled_mode = Kint::MODE_PLAIN;
31
     * Kint::dump( $variable );
32
     *
33
     * @return string
34
     */
35
    function s()
0 ignored issues
show
Coding Style introduced by
This method's name is shorter than the configured minimum length of 3 characters.

Even though PHP does not care about the name of your methods, it is generally a good practice to choose method names which can be easily understood by other human readers.

Loading history...
36
    {
37
        if (!Kint::$enabled_mode) {
38
            return 0;
39
        }
40
41
        $stash = Kint::settings();
42
43 View Code Duplication
        if (Kint::$enabled_mode !== Kint::MODE_TEXT) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
44
            Kint::$enabled_mode = Kint::MODE_PLAIN;
45
            if (PHP_SAPI === 'cli' && Kint::$cli_detection === true) {
46
                Kint::$enabled_mode = Kint::$mode_default_cli;
47
            }
48
        }
49
50
        $args = func_get_args();
51
        $out = call_user_func_array(array('Kint', 'dump'), $args);
52
53
        Kint::settings($stash);
54
55
        return $out;
56
    }
57
58
    Kint::$aliases[] = 's';
59
}
60