Type::set_type()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 6
rs 9.4285
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