Completed
Push — master ( 722949...84d505 )
by J.D.
27:47 queued 26:57
created

WordPoints_App_Registry::get_all_slugs()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
/**
4
 * Class for apps that are also class registries.
5
 *
6
 * @package wordpoints-hooks-api
7
 * @since   1.0.0
8
 */
9
10
/**
11
 * An app that is also a class registry.
12
 *
13
 * @since 1.0.0
14
 */
15
class WordPoints_App_Registry
16
	extends WordPoints_App
17
	implements WordPoints_Class_RegistryI {
18
19
	/**
20
	 * The class registry object.
21
	 *
22
	 * @since 1.0.0
23
	 *
24
	 * @var WordPoints_Class_Registry
25
	 */
26
	protected $registry;
27
28
	/**
29
	 * @since 1.0.0
30
	 */
31
	public function __construct( $slug ) {
32
33
		$this->registry = new WordPoints_Class_Registry();
34
35
		parent::__construct( $slug );
36
	}
37
38
	/**
39
	 * @since 1.0.0
40
	 */
41
	public function get_all( array $args = array() ) {
42
		return $this->registry->get_all( $args );
43
	}
44
45
	/**
46
	 * @since 1.0.0
47
	 */
48
	public function get_all_slugs() {
49
		return $this->registry->get_all_slugs();
50
	}
51
52
	/**
53
	 * @since 1.0.0
54
	 */
55
	public function get( $slug, array $args = array() ) {
56
		return $this->registry->get( $slug, $args );
57
	}
58
59
	/**
60
	 * @since 1.0.0
61
	 */
62
	public function register( $slug, $class, array $args = array() ) {
63
		return $this->registry->register( $slug, $class, $args );
64
	}
65
66
	/**
67
	 * @since 1.0.0
68
	 */
69
	public function deregister( $slug ) {
70
		$this->registry->deregister( $slug );
71
	}
72
73
	/**
74
	 * @since 1.0.0
75
	 */
76
	public function is_registered( $slug ) {
77
		return $this->registry->is_registered( $slug );
78
	}
79
}
80
81
// EOF
82