Completed
Push — master ( afe740...a74724 )
by
unknown
03:38
created

Blog_ID_Condition::is_fulfilled()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 6
c 1
b 0
f 1
nc 1
nop 1
dl 0
loc 8
rs 9.4285
1
<?php
2
3
namespace Carbon_Fields\Container\Condition;
4
5
/**
6
 * Check if the current blog has a specific id
7
 */
8
class Blog_ID_Condition extends Condition {
9
10
	/**
11
	 * Check if the condition is fulfilled
12
	 *
13
	 * @param  array $environment
14
	 * @return bool
15
	 */
16
	public function is_fulfilled( $environment ) {
17
		$blog_id = get_current_blog_id();
18
		return $this->compare(
19
			$blog_id,
20
			$this->get_comparison_operator(),
21
			$this->get_value()
22
		);
23
	}
24
}