Completed
Push — develop ( 9892da...c6a3a9 )
by
unknown
28s queued 10s
created

Filler_Posts   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A get_posts_config() 0 14 1
get_posts() 0 1 ?
1
<?php
2
3
namespace Wordlift\Widgets\Navigator\Filler_Posts;
4
/**
5
 * @since 3.27.8
6
 * @author Naveen Muthusamy <[email protected]>
7
 */
8
abstract class Filler_Posts {
9
10
	/**
11
	 * @var int
12
	 */
13
	public $filler_count;
14
15
	/**
16
	 * @var array<int>
17
	 */
18
	public $post_ids_to_be_excluded;
19
20
	/**
21
	 * @var $post_id int
22
	 */
23
	protected $post_id;
24
25
	/**
26
	 * Filler_Posts constructor.
27
	 *
28
	 * @param $post_id
29
	 */
30
	public function __construct( $post_id ) {
31
32
		$this->post_id = $post_id;
33
34
	}
35
36
	protected function get_posts_config($filler_count, $post_ids_to_be_excluded) {
37
38
		return array(
39
			'meta_query'          => array(
40
				array(
41
					'key' => '_thumbnail_id'
42
				)
43
			),
44
			'numberposts'         => $filler_count,
45
			'post__not_in'        => $post_ids_to_be_excluded,
46
			'ignore_sticky_posts' => 1
47
		);
48
49
	}
50
51
	/**
52
	 * @param $filler_count
53
	 * @param $post_ids_to_be_excluded
54
	 *
55
	 * @return array<\WP_Post>
56
	 */
57
	abstract function get_posts( $filler_count, $post_ids_to_be_excluded );
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
58
59
60
}
61