Completed
Pull Request — dev/5.7.0 (#195)
by
unknown
05:37 queued 02:48
created

BD_Base_Addon   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 41
ccs 0
cts 9
cp 0
rs 10
c 1
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A get_cron_hook() 0 2 1
A get_module() 0 2 1
A setup_hooks() 0 1 1
A __construct() 0 2 1
1
<?php
2
/**
3
 * Base class for all Base Addons.
4
 *
5
 * @since   5.5
6
 *
7
 * @author  Sudar
8
 *
9
 * @package BulkDelete\Addons\Base
10
 */
11
defined( 'ABSPATH' ) || exit; // Exit if accessed directly
12
13
/**
14
 * Base class for Base Addons.
15
 *
16
 * @abstract
17
 *
18
 * @since 5.5
19
 */
20
abstract class BD_Base_Addon extends BD_Addon {
21
	/**
22
	 * Use `factory()` method to create instance of this class.
23
	 * Don't create instances directly.
24
	 *
25
	 * @since 5.5
26
	 * @see factory()
27
	 */
28
	public function __construct() {
29
		parent::__construct();
30
	}
31
32
	/**
33
	 * Setup hooks.
34
	 * This can be overridden by the child class.
35
	 *
36
	 * @since 5.5
37
	 */
38
	protected function setup_hooks() {
39
	}
40
41
	/**
42
	 * Getter for cron hook.
43
	 *
44
	 * @since 5.5
45
	 *
46
	 * @return string Cron hook.
47
	 */
48
	public function get_cron_hook() {
49
		return $this->module->get_cron_hook();
50
	}
51
52
	/**
53
	 * Return reference to the module.
54
	 *
55
	 * @since 5.5
56
	 *
57
	 * @return Module Reference to Module Object
58
	 */
59
	public function get_module() {
60
		return $this->module;
61
	}
62
}
63