Passed
Branch master (a2c52f)
by Chris
02:59
created

asplode()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 4
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Helper functions for the Darya framework.
4
 *
5
 * @author Chris Andrew <[email protected]>
6
 */
7
8
if (!function_exists('asplode')) {
9
	function asplode($delimiter, $string, $limit, $pad = null) {
10
		return array_pad(explode($delimiter, $string, $limit), $limit, $pad);
11
	}
12
}
13
14
if (!function_exists('read_json_file')) {
15
	function read_json_file($path) {
16
		return json_decode(file_get_contents($path), true);
17
	}
18
}
19
20
if (!function_exists('file_read_json')) {
21
	function file_read_json($path) {
22
		return read_json_file($path);
23
	}
24
}
25