MslsOptionsQueryPostType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A has_value() 0 6 2
A get_current_link() 0 3 1
1
<?php
2
/**
3
 * MslsOptionsQueryPostType
4
 * @author Dennis Ploetner <[email protected]>
5
 * @since 0.9.8
6
 */
7
8
namespace lloc\Msls;
9
10
/**
11
 * OptionsQueryPostType
12
 *
13
 * @package Msls
14
 */
15
class MslsOptionsQueryPostType extends MslsOptionsQuery {
16
17
	/**
18
	 * Check if the array has an non empty item which has $language as a key
19
	 *
20
	 * @param string $language
21
	 * @return bool
22
	 */
23
	public function has_value( $language ) {
24
		if ( ! isset( $this->arr[ $language ] ) ) {
25
			$this->arr[ $language ] = get_post_type_object( $this->get_arg( 0, '' ) );
26
		}
27
		return (bool) $this->arr[ $language ];
28
	}
29
30
	/**
31
	 * Get current link
32
	 *
33
	 * @return string
34
	 */
35
	public function get_current_link() {
36
		return (string) get_post_type_archive_link( $this->get_arg( 0, '' ) );
37
	}
38
39
}
40