Type   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register_type() 0 5 1
A set_type() 0 6 1
1
<?php
2
namespace testContent\Abstracts;
3
4
/**
5
 * Class to generate a type for the admin page.
6
 *
7
 * @abstract
8
 * @package    WordPress
9
 * @subpackage Test Content
10
 * @author     Old Town Media
11
 */
12
abstract class Type{
13
14
	/**
15
	 * type
16
	 * Type of objects we'll be dealing with i.e.: post or term.
17
	 *
18
	 * @var string
19
	 * @access protected
20
	 */
21
	protected $type;
22
23
	/**
24
	 * connected
25
	 * Whether or not we're successfully connected to the Internet.
26
	 *
27
	 * @var boolean
28
	 * @access private
29
	 */
30
	protected $connected;
31
32
33
	/**
34
	 * Registers the type with the rest of the plugin
35
	 */
36
	public function register_type(){
37
38
		add_filter( 'tc-types', array( $this, 'set_type' ) );
39
40
	}
41
42
43
	/**
44
	 * Sets the type in the type array for use by the rest of the plugin.
45
	 *
46
	 * @param array $types Original types array
47
	 * @return array Modified types array with our current type
48
	 */
49
	public function set_type( $types ){
50
51
		$types[] = $this->type;
52
		return $types;
53
54
	}
55
56
}
57