Test Failed
Push — all-contributors/add-CVinicius... ( d7cbed )
by
unknown
07:56 queued 03:58
created

ddd()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 4
rs 10
c 1
b 0
f 0
1
<?php
2
3
/**
4
 * JPGraph v4.1.0-beta.01
5
 */
6
if (!defined('STDIN')) {
7
    define('STDIN', fopen('php://stdin', 'rb'));
8
}
9
10
if (!defined('STDOUT')) {
11
    define('STDOUT', fopen('php://stdout', 'wb'));
12
}
13
14
if (!defined('STDERR')) {
15
    define('STDERR', fopen('php://stderr', 'wb'));
16
}
17
18
if (!class_exists('\Kint')) {
19
    /**
20
     * Class that mocks Kint
21
     * (will use this when dev dependencies are not installed).
22
     */
23
    class Kint
24
    {
25
        public static $enabled_mode     = true;
26
        public static $aliases          = [];
27
        public static $mode_default_cli = false;
28
        public static function dump()
29
        {
30
        }
31
    }
32
}
33
if (class_exists('\Kint\Renderer\RichRenderer')) {
34
    \Kint\Renderer\RichRenderer::$folder = false;
35
}
36
if (method_exists('\Kint', 'enabled')) {
37
    \Kint::enabled(DEBUGMODE);
38
} elseif (property_exists('\Kint', 'enabled_mode')) {
39
    \Kint::$enabled_mode = Kint::$mode_default_cli;
40
}
41
42
if (!class_exists('\PhpConsole\Handler')) {
43
    /**
44
     * Class that mocks PHP-Console debug feature.
45
     */
46
    class PC
47
    {
48
        public static function debug()
49
        {
50
        }
51
    }
52
}
53
function ddd(...$vars)
54
{
55
    Kint::dump(...$vars);
0 ignored issues
show
Unused Code introduced by
The call to Kint::dump() has too many arguments starting with $vars. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

55
    Kint::/** @scrutinizer ignore-call */ 
56
          dump(...$vars);

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
56
    exit;
0 ignored issues
show
Best Practice introduced by
Using exit here is not recommended.

In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.

Loading history...
57
}
58
59
function kdump(...$vars)
60
{
61
    ob_start();
62
63
    d(...$vars);
64
65
    $kintdump = (ob_get_clean());
66
67
    //dump($kintdump);
68
    fwrite(STDERR, $kintdump);
69
}
70
71
\Kint::$aliases[] = 'ddd';
72
\Kint::$aliases[] = 'kdump';
73
74
if (getenv('JPGRAPH_USE_PHPCONSOLE') &&
75
    isset($_SERVER['HTTP_USER_AGENT']) &&
76
    strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== false
77
) {
78
    $handler = \PhpConsole\Handler::getInstance();
79
    \PhpConsole\Helper::register();
80
    $handler->start();
81
    \PC::debug('Started');
82
}
83