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

Blog_ID_Condition   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 17
rs 10
wmc 1
lcom 1
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A is_fulfilled() 0 8 1
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
}