helpers.php ➔ appVersion()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 6
ccs 3
cts 3
cp 1
crap 1
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
	 * @codeCoverageIgnore
8
	 *
9
	 * @param  mixed
10
	 * @return void
11
	 */
12
	function dd() {
13
		array_map(function ($x){
14
			(\Tracy\Debugger::dump($x));
15
		}, func_get_args());
16
17
		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...
18
	}
19
}
20
21
if(!function_exists('appVersion')) {
22
	/**
23
	 * Get application version from package.json
24
	 *
25
	 * @return string
26
	 */
27
	function appVersion() {
28 1
		$packagePath = realpath(__DIR__ . '/../package.json');
29 1
		$package = json_decode(file_get_contents($packagePath));
30
31 1
		return $package->version;
32
	}
33
}
34