Completed
Push — develop ( 33d89e...7ab65a )
by Peter
12:20
created

functions.php ➔ bd()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
nc 2
nop 1
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * Webino (http://webino.sk/)
4
 *
5
 * @link        https://github.com/webino/WebinoDev/ for the canonical source repository
6
 * @copyright   Copyright (c) 2014-2017 Webino, s. r. o. (http://webino.sk/)
7
 * @license     BSD-3-Clause
8
 */
9
10
use Tracy\Debugger;
11
12
/**
13
 * Alias for var_dump()
14
 *
15
 * @param mixed $subject
16
 */
17
function d($subject) {
18
    var_dump($subject);
19
}
20
21
/**
22
 * Diyng var_dump()
23
 *
24
 * @param mixed $subject
25
 */
26
function dd($subject) {
27
    var_dump($subject);
28
    exit;
29
}
30
31
/**
32
 * Alias for print_r() scream
33
 *
34
 * @param mixed $subject
35
 */
36
function p($subject) {
37
    if (class_exists(Debugger::class)) {
38
        Debugger::dump($subject);
39
        return;
40
    }
41
42
    print_r($subject);
43
}
44
45
/**
46
 * Dying print_r() scream
47
 *
48
 * @param mixed $subject
49
 */
50
function pd($subject) {
51
    if (class_exists(Debugger::class)) {
52
        Debugger::dump($subject);
53
        exit;
54
    }
55
56
    print_r($subject);
57
    exit;
58
}
59
60
/**
61
 * Alias for print_r() return
62
 *
63
 * @param mixed $subject
64
 * @return string
65
 */
66
function pr($subject) {
67
    if (class_exists(Debugger::class)) {
68
        return Debugger::dump($subject, true);
69
    }
70
71
    return print_r($subject, true);
72
}
73
74
/**
75
 * Debugger bar dump
76
 *
77
 * @param mixed $subject
78
 */
79
function bd($subject) {
80
    if (class_exists(Debugger::class)) {
81
        Debugger::barDump($subject);
82
    }
83
}
84
85
/**
86
 * Web debugger break point
87
 *
88
 * Sometimes is useful by throwing an exception to check a backtrace.
89
 *
90
 * @link https://github.com/webino/WebinoDebug Web debugger
91
 * @param string $msg
92
 */
93
function e($msg = '') {
94
    throw new \WebinoDev\Exception\DevelopmentException($msg);
95
}
96
97
/**
98
 * For testing purposes only
99
 *
100
 * @return bool
101
 */
102
function isSelenium()
103
{
104
    return file_exists('tmp/common/selenium.lock');
105
}
106