Test Failed
Branch devel (807472)
by Litera
06:16
created

helpers.php ➔ dd()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 5
nc 1
nop 0
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
if(!function_exists('dd')) {
4
	/**
5
	 * Dump the passed variables and end the script.
6
	 *
7
	 * @param  mixed
8
	 * @return void
9
	 */
10
	function dd() {
11
		array_map(function ($x){
12
			(\Tracy\Debugger::dump($x));
13
		}, func_get_args());
14
15
		die(1);
0 ignored issues
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...
16
	}
17
}
18
19
if(!function_exists('appVersion')) {
20
	/**
21
	 * Get application version from package.json
22
	 *
23
	 * @return string
24
	 */
25
	function appVersion() {
26
		$packagePath = realpath(__DIR__ . '/../package.json');
27
		$package = json_decode(file_get_contents($packagePath));
28
29
		return $package->version;
30
	}
31
}
32