Completed
Push — develop ( 18a26b...e6f109 )
by Gennady
16:45
created

GF_Query_Condition_IS_NULL   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A sql() 0 3 1
1
<?php
2
namespace GV\Mocks;
3
4
/**
5
 * Gravity Forms GF_Query does not support NULL condition clauses.
6
 *
7
 * Implement them as needed.
8
 */
9
class GF_Query_Condition_IS_NULL extends \GF_Query_Condition {
10
	private $override_placeholder = '{GF_Query_Condition_IS_NULL_override}';
11
12
	public function __construct( $left = null, $operator = null, $right = null ) {
13
		parent::__construct( $left, self::EQ, new \GF_Query_Literal( $this->override_placeholder ) );
14
	}
15
16
	public function sql( $query ) {
17
		return str_replace( "= '{$this->override_placeholder}'", 'IS NULL', parent::sql( $query ) );
18
	}
19
}
20