Failed Conditions
Push — develop ( 700cbd...25e20e )
by Remco
03:48
created

Util::is_not_null()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 2
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * Util
4
 *
5
 * @author    Pronamic <[email protected]>
6
 * @copyright 2005-2019 Pronamic
7
 * @license   GPL-3.0-or-later
8
 * @package   Pronamic\WordPress\Pay\Gateways\Adyen
9
 */
10
11
namespace Pronamic\WordPress\Pay\Gateways\Adyen;
12
13
/**
14
 * Util
15
 *
16
 * @author  Remco Tolsma
17
 * @version 1.0.0
18
 * @since   1.0.0
19
 */
20
class Util {
21
	/**
22
	 * Filter null.
23
	 *
24
	 * @param array $array Array to filter null values from.
25
	 * @return array
26
	 */
27 7
	public static function filter_null( $array ) {
28 7
		return array_filter( $array, array( __CLASS__, 'is_not_null' ) );
29
	}
30
31
	/**
32
	 * Check if value is not null.
33
	 *
34
	 * @param mixed $value Value.
35
	 * @return boolean True if value is not null, false otherwise.
36
	 */
37 7
	private static function is_not_null( $value ) {
38 7
		return ( null !== $value );
39
	}
40
}
41