@@ -44,21 +44,21 @@ discard block |
||
44 | 44 | * |
45 | 45 | * @since 1.0.0 |
46 | 46 | */ |
47 | -require_once( dirname( __FILE__ ) . '/includes/constants.php' ); |
|
47 | +require_once(dirname(__FILE__).'/includes/constants.php'); |
|
48 | 48 | |
49 | 49 | /** |
50 | 50 | * The module's functions. |
51 | 51 | * |
52 | 52 | * @since 1.0.0 |
53 | 53 | */ |
54 | -require_once( dirname( __FILE__ ) . '/includes/functions.php' ); |
|
54 | +require_once(dirname(__FILE__).'/includes/functions.php'); |
|
55 | 55 | |
56 | 56 | /** |
57 | 57 | * The module's actions and filters. |
58 | 58 | * |
59 | 59 | * @since 1.0.0 |
60 | 60 | */ |
61 | -require_once( dirname( __FILE__ ) . '/includes/actions.php' ); |
|
61 | +require_once(dirname(__FILE__).'/includes/actions.php'); |
|
62 | 62 | |
63 | 63 | /** |
64 | 64 | * Class autoloader. |
@@ -67,22 +67,22 @@ discard block |
||
67 | 67 | * |
68 | 68 | * @since 1.0.0 |
69 | 69 | */ |
70 | -require_once( dirname( __FILE__ ) . '/includes/classes/class/autoloader.php' ); |
|
70 | +require_once(dirname(__FILE__).'/includes/classes/class/autoloader.php'); |
|
71 | 71 | |
72 | 72 | // Register the classes to autoload. |
73 | 73 | WordPoints_Class_Autoloader::register_dir( |
74 | - dirname( __FILE__ ) . '/includes/classes' |
|
74 | + dirname(__FILE__).'/includes/classes' |
|
75 | 75 | , 'WordPoints_' |
76 | 76 | ); |
77 | 77 | |
78 | -if ( is_admin() ) { |
|
78 | +if (is_admin()) { |
|
79 | 79 | |
80 | 80 | /** |
81 | 81 | * Administration-side code. |
82 | 82 | * |
83 | 83 | * @since 1.0.0 |
84 | 84 | */ |
85 | - require_once( dirname( __FILE__ ) . '/admin/admin.php' ); |
|
85 | + require_once(dirname(__FILE__).'/admin/admin.php'); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | // EOF |
@@ -7,21 +7,21 @@ |
||
7 | 7 | * @since 1.0.0 |
8 | 8 | */ |
9 | 9 | |
10 | -add_action( 'wordpoints_init_app-apps', 'wordpoints_apps_init' ); |
|
11 | -add_action( 'wordpoints_init_app-entities', 'wordpoints_entities_app_init' ); |
|
10 | +add_action('wordpoints_init_app-apps', 'wordpoints_apps_init'); |
|
11 | +add_action('wordpoints_init_app-entities', 'wordpoints_entities_app_init'); |
|
12 | 12 | |
13 | -add_action( 'wordpoints_init_app_registry-apps-entities', 'wordpoints_entities_init' ); |
|
14 | -add_action( 'wordpoints_init_app_registry-apps-data_types', 'wordpoints_data_types_init' ); |
|
13 | +add_action('wordpoints_init_app_registry-apps-entities', 'wordpoints_entities_init'); |
|
14 | +add_action('wordpoints_init_app_registry-apps-data_types', 'wordpoints_data_types_init'); |
|
15 | 15 | |
16 | -add_action( 'wordpoints_init_app_registry-hooks-firers', 'wordpoints_hook_firers_init' ); |
|
17 | -add_action( 'wordpoints_init_app_registry-hooks-events', 'wordpoints_hook_events_init' ); |
|
18 | -add_action( 'wordpoints_init_app_registry-hooks-actions', 'wordpoints_hook_actions_init' ); |
|
19 | -add_action( 'wordpoints_init_app_registry-hooks-reactors', 'wordpoints_hook_reactors_init' ); |
|
20 | -add_action( 'wordpoints_init_app_registry-hooks-extensions', 'wordpoints_hook_extension_init' ); |
|
21 | -add_action( 'wordpoints_init_app_registry-hooks-conditions', 'wordpoints_hook_conditions_init' ); |
|
16 | +add_action('wordpoints_init_app_registry-hooks-firers', 'wordpoints_hook_firers_init'); |
|
17 | +add_action('wordpoints_init_app_registry-hooks-events', 'wordpoints_hook_events_init'); |
|
18 | +add_action('wordpoints_init_app_registry-hooks-actions', 'wordpoints_hook_actions_init'); |
|
19 | +add_action('wordpoints_init_app_registry-hooks-reactors', 'wordpoints_hook_reactors_init'); |
|
20 | +add_action('wordpoints_init_app_registry-hooks-extensions', 'wordpoints_hook_extension_init'); |
|
21 | +add_action('wordpoints_init_app_registry-hooks-conditions', 'wordpoints_hook_conditions_init'); |
|
22 | 22 | |
23 | -add_action( 'wordpoints_modules_loaded', 'wordpoints_init_hooks' ); |
|
23 | +add_action('wordpoints_modules_loaded', 'wordpoints_init_hooks'); |
|
24 | 24 | |
25 | -add_filter( 'wordpoints_user_can_view_points_log', 'wordpoints_hooks_user_can_view_points_log' ); |
|
25 | +add_filter('wordpoints_user_can_view_points_log', 'wordpoints_hooks_user_can_view_points_log'); |
|
26 | 26 | |
27 | 27 | // EOF |
@@ -28,46 +28,46 @@ |
||
28 | 28 | /** |
29 | 29 | * @since 1.0.0 |
30 | 30 | */ |
31 | - public function __construct( $slug ) { |
|
31 | + public function __construct($slug) { |
|
32 | 32 | |
33 | 33 | $this->registry = new WordPoints_Class_Registry(); |
34 | 34 | |
35 | - parent::__construct( $slug ); |
|
35 | + parent::__construct($slug); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
39 | 39 | * @since 1.0.0 |
40 | 40 | */ |
41 | - public function get_all( array $args = array() ) { |
|
42 | - return $this->registry->get_all( $args ); |
|
41 | + public function get_all(array $args = array()) { |
|
42 | + return $this->registry->get_all($args); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | /** |
46 | 46 | * @since 1.0.0 |
47 | 47 | */ |
48 | - public function get( $slug, array $args = array() ) { |
|
49 | - return $this->registry->get( $slug, $args ); |
|
48 | + public function get($slug, array $args = array()) { |
|
49 | + return $this->registry->get($slug, $args); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
53 | 53 | * @since 1.0.0 |
54 | 54 | */ |
55 | - public function register( $slug, $class, array $args = array() ) { |
|
56 | - return $this->registry->register( $slug, $class, $args ); |
|
55 | + public function register($slug, $class, array $args = array()) { |
|
56 | + return $this->registry->register($slug, $class, $args); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
60 | 60 | * @since 1.0.0 |
61 | 61 | */ |
62 | - public function deregister( $slug ) { |
|
63 | - $this->registry->deregister( $slug ); |
|
62 | + public function deregister($slug) { |
|
63 | + $this->registry->deregister($slug); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
67 | 67 | * @since 1.0.0 |
68 | 68 | */ |
69 | - public function is_registered( $slug ) { |
|
70 | - return $this->registry->is_registered( $slug ); |
|
69 | + public function is_registered($slug) { |
|
70 | + return $this->registry->is_registered($slug); |
|
71 | 71 | } |
72 | 72 | } |
73 | 73 |
@@ -62,15 +62,15 @@ discard block |
||
62 | 62 | * @param string $dir The full path of the directory. |
63 | 63 | * @param string $prefix The prefix used for class names in this directory. |
64 | 64 | */ |
65 | - public static function register_dir( $dir, $prefix ) { |
|
65 | + public static function register_dir($dir, $prefix) { |
|
66 | 66 | |
67 | - if ( ! self::$added_action ) { |
|
68 | - add_action( 'wordpoints_modules_loaded', __CLASS__ . '::init', 0 ); |
|
67 | + if ( ! self::$added_action) { |
|
68 | + add_action('wordpoints_modules_loaded', __CLASS__.'::init', 0); |
|
69 | 69 | self::$added_action = true; |
70 | 70 | } |
71 | 71 | |
72 | - self::$prefixes[ $prefix ]['length'] = strlen( $prefix ); |
|
73 | - self::$prefixes[ $prefix ]['dirs'][] = trailingslashit( $dir ); |
|
72 | + self::$prefixes[$prefix]['length'] = strlen($prefix); |
|
73 | + self::$prefixes[$prefix]['dirs'][] = trailingslashit($dir); |
|
74 | 74 | |
75 | 75 | self::$sorted = false; |
76 | 76 | } |
@@ -86,31 +86,31 @@ discard block |
||
86 | 86 | * |
87 | 87 | * @param string $class_name The name fo the class to load. |
88 | 88 | */ |
89 | - public static function load_class( $class_name ) { |
|
89 | + public static function load_class($class_name) { |
|
90 | 90 | |
91 | - if ( ! self::$sorted ) { |
|
92 | - arsort( self::$prefixes ); |
|
91 | + if ( ! self::$sorted) { |
|
92 | + arsort(self::$prefixes); |
|
93 | 93 | self::$sorted = true; |
94 | 94 | } |
95 | 95 | |
96 | - foreach ( self::$prefixes as $prefix => $data ) { |
|
96 | + foreach (self::$prefixes as $prefix => $data) { |
|
97 | 97 | |
98 | - if ( substr( $class_name, 0, $data['length'] ) !== $prefix ) { |
|
98 | + if (substr($class_name, 0, $data['length']) !== $prefix) { |
|
99 | 99 | continue; |
100 | 100 | } |
101 | 101 | |
102 | - $trimmed_class_name = substr( $class_name, $data['length'] ); |
|
102 | + $trimmed_class_name = substr($class_name, $data['length']); |
|
103 | 103 | |
104 | - $file_name = str_replace( '_', '/', strtolower( $trimmed_class_name ) ); |
|
105 | - $file_name = $file_name . '.php'; |
|
104 | + $file_name = str_replace('_', '/', strtolower($trimmed_class_name)); |
|
105 | + $file_name = $file_name.'.php'; |
|
106 | 106 | |
107 | - foreach ( $data['dirs'] as $dir ) { |
|
107 | + foreach ($data['dirs'] as $dir) { |
|
108 | 108 | |
109 | - if ( ! file_exists( $dir . $file_name ) ) { |
|
109 | + if ( ! file_exists($dir.$file_name)) { |
|
110 | 110 | continue; |
111 | 111 | } |
112 | 112 | |
113 | - require_once( $dir . $file_name ); |
|
113 | + require_once($dir.$file_name); |
|
114 | 114 | |
115 | 115 | return; |
116 | 116 | } |
@@ -135,16 +135,16 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public static function init() { |
137 | 137 | |
138 | - if ( function_exists( 'spl_autoload_register' ) ) { |
|
138 | + if (function_exists('spl_autoload_register')) { |
|
139 | 139 | |
140 | - spl_autoload_register( __CLASS__ . '::load_class' ); |
|
140 | + spl_autoload_register(__CLASS__.'::load_class'); |
|
141 | 141 | |
142 | 142 | } else { |
143 | 143 | |
144 | - foreach ( self::$prefixes as $prefix => $data ) { |
|
145 | - foreach ( $data['dirs'] as $dir ) { |
|
146 | - if ( file_exists( $dir . '/index.php' ) ) { |
|
147 | - require( $dir . '/index.php' ); |
|
144 | + foreach (self::$prefixes as $prefix => $data) { |
|
145 | + foreach ($data['dirs'] as $dir) { |
|
146 | + if (file_exists($dir.'/index.php')) { |
|
147 | + require($dir.'/index.php'); |
|
148 | 148 | } |
149 | 149 | } |
150 | 150 | } |
@@ -30,39 +30,39 @@ discard block |
||
30 | 30 | /** |
31 | 31 | * @since 1.0.0 |
32 | 32 | */ |
33 | - public function get_all( array $args = array() ) { |
|
34 | - return self::construct_with_args( $this->classes, $args ); |
|
33 | + public function get_all(array $args = array()) { |
|
34 | + return self::construct_with_args($this->classes, $args); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
38 | 38 | * @since 1.0.0 |
39 | 39 | */ |
40 | - public function get( $slug, array $args = array() ) { |
|
40 | + public function get($slug, array $args = array()) { |
|
41 | 41 | |
42 | - if ( ! isset( $this->classes[ $slug ] ) ) { |
|
42 | + if ( ! isset($this->classes[$slug])) { |
|
43 | 43 | return false; |
44 | 44 | } |
45 | 45 | |
46 | - if ( ! empty( $args ) ) { |
|
46 | + if ( ! empty($args)) { |
|
47 | 47 | |
48 | - array_unshift( $args, $slug ); |
|
48 | + array_unshift($args, $slug); |
|
49 | 49 | |
50 | 50 | return wordpoints_construct_class_with_args( |
51 | - $this->classes[ $slug ] |
|
51 | + $this->classes[$slug] |
|
52 | 52 | , $args |
53 | 53 | ); |
54 | 54 | |
55 | 55 | } else { |
56 | - return new $this->classes[ $slug ]( $slug ); |
|
56 | + return new $this->classes[$slug]($slug); |
|
57 | 57 | } |
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
61 | 61 | * @since 1.0.0 |
62 | 62 | */ |
63 | - public function register( $slug, $class, array $args = array() ) { |
|
63 | + public function register($slug, $class, array $args = array()) { |
|
64 | 64 | |
65 | - $this->classes[ $slug ] = $class; |
|
65 | + $this->classes[$slug] = $class; |
|
66 | 66 | |
67 | 67 | return true; |
68 | 68 | } |
@@ -70,17 +70,17 @@ discard block |
||
70 | 70 | /** |
71 | 71 | * @since 1.0.0 |
72 | 72 | */ |
73 | - public function deregister( $slug ) { |
|
73 | + public function deregister($slug) { |
|
74 | 74 | |
75 | - unset( $this->classes[ $slug ] ); |
|
75 | + unset($this->classes[$slug]); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
79 | 79 | * @since 1.0.0 |
80 | 80 | */ |
81 | - public function is_registered( $slug ) { |
|
81 | + public function is_registered($slug) { |
|
82 | 82 | |
83 | - return isset( $this->classes[ $slug ] ); |
|
83 | + return isset($this->classes[$slug]); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | /** |
@@ -94,24 +94,24 @@ discard block |
||
94 | 94 | * |
95 | 95 | * @return object[] An array of the constructed objects. |
96 | 96 | */ |
97 | - public static function construct_with_args( array $classes, array $args ) { |
|
97 | + public static function construct_with_args(array $classes, array $args) { |
|
98 | 98 | |
99 | 99 | $objects = array(); |
100 | 100 | |
101 | - if ( empty( $args ) ) { |
|
101 | + if (empty($args)) { |
|
102 | 102 | |
103 | - foreach ( $classes as $slug => $class ) { |
|
104 | - $objects[ $slug ] = new $class( $slug ); |
|
103 | + foreach ($classes as $slug => $class) { |
|
104 | + $objects[$slug] = new $class($slug); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | } else { |
108 | 108 | |
109 | - array_unshift( $args, null ); |
|
109 | + array_unshift($args, null); |
|
110 | 110 | |
111 | - foreach ( $classes as $slug => $class ) { |
|
112 | - $objects[ $slug ] = wordpoints_construct_class_with_args( |
|
111 | + foreach ($classes as $slug => $class) { |
|
112 | + $objects[$slug] = wordpoints_construct_class_with_args( |
|
113 | 113 | $class |
114 | - , array( $slug ) + $args |
|
114 | + , array($slug) + $args |
|
115 | 115 | ); |
116 | 116 | } |
117 | 117 | } |
@@ -33,12 +33,12 @@ discard block |
||
33 | 33 | /** |
34 | 34 | * @since 1.0.0 |
35 | 35 | */ |
36 | - public function get_all( array $args = array() ) { |
|
36 | + public function get_all(array $args = array()) { |
|
37 | 37 | |
38 | 38 | $items = array(); |
39 | 39 | |
40 | - foreach ( $this->classes as $parent_slug => $classes ) { |
|
41 | - $items[ $parent_slug ] = WordPoints_Class_Registry::construct_with_args( |
|
40 | + foreach ($this->classes as $parent_slug => $classes) { |
|
41 | + $items[$parent_slug] = WordPoints_Class_Registry::construct_with_args( |
|
42 | 42 | $classes |
43 | 43 | , $args |
44 | 44 | ); |
@@ -50,14 +50,14 @@ discard block |
||
50 | 50 | /** |
51 | 51 | * @since 1.0.0 |
52 | 52 | */ |
53 | - public function get_children( $parent_slug, array $args = array() ) { |
|
53 | + public function get_children($parent_slug, array $args = array()) { |
|
54 | 54 | |
55 | 55 | $items = array(); |
56 | 56 | |
57 | - if ( isset( $this->classes[ $parent_slug ] ) ) { |
|
57 | + if (isset($this->classes[$parent_slug])) { |
|
58 | 58 | |
59 | 59 | $items = WordPoints_Class_Registry::construct_with_args( |
60 | - $this->classes[ $parent_slug ] |
|
60 | + $this->classes[$parent_slug] |
|
61 | 61 | , $args |
62 | 62 | ); |
63 | 63 | } |
@@ -68,29 +68,29 @@ discard block |
||
68 | 68 | /** |
69 | 69 | * @since 1.0.0 |
70 | 70 | */ |
71 | - public function get( $parent_slug, $slug, array $args = array() ) { |
|
71 | + public function get($parent_slug, $slug, array $args = array()) { |
|
72 | 72 | |
73 | - if ( ! isset( $this->classes[ $parent_slug ][ $slug ] ) ) { |
|
73 | + if ( ! isset($this->classes[$parent_slug][$slug])) { |
|
74 | 74 | return false; |
75 | 75 | } |
76 | 76 | |
77 | - $class = $this->classes[ $parent_slug ][ $slug ]; |
|
77 | + $class = $this->classes[$parent_slug][$slug]; |
|
78 | 78 | |
79 | - if ( empty( $args ) ) { |
|
80 | - return new $class( $slug ); |
|
79 | + if (empty($args)) { |
|
80 | + return new $class($slug); |
|
81 | 81 | } else { |
82 | - array_unshift( $args, $slug ); |
|
82 | + array_unshift($args, $slug); |
|
83 | 83 | |
84 | - return wordpoints_construct_class_with_args( $class, $args ); |
|
84 | + return wordpoints_construct_class_with_args($class, $args); |
|
85 | 85 | } |
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
89 | 89 | * @since 1.0.0 |
90 | 90 | */ |
91 | - public function register( $parent_slug, $slug, $class, array $args = array() ) { |
|
91 | + public function register($parent_slug, $slug, $class, array $args = array()) { |
|
92 | 92 | |
93 | - $this->classes[ $parent_slug ][ $slug ] = $class; |
|
93 | + $this->classes[$parent_slug][$slug] = $class; |
|
94 | 94 | |
95 | 95 | return true; |
96 | 96 | } |
@@ -98,26 +98,26 @@ discard block |
||
98 | 98 | /** |
99 | 99 | * @since 1.0.0 |
100 | 100 | */ |
101 | - public function deregister( $parent_slug, $slug ) { |
|
102 | - unset( $this->classes[ $parent_slug ][ $slug ] ); |
|
101 | + public function deregister($parent_slug, $slug) { |
|
102 | + unset($this->classes[$parent_slug][$slug]); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
106 | 106 | * @since 1.0.0 |
107 | 107 | */ |
108 | - public function deregister_children( $parent_slug ) { |
|
109 | - unset( $this->classes[ $parent_slug ] ); |
|
108 | + public function deregister_children($parent_slug) { |
|
109 | + unset($this->classes[$parent_slug]); |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | /** |
113 | 113 | * @since 1.0.0 |
114 | 114 | */ |
115 | - public function is_registered( $parent_slug, $slug = null ) { |
|
115 | + public function is_registered($parent_slug, $slug = null) { |
|
116 | 116 | |
117 | - if ( isset( $slug ) ) { |
|
118 | - return isset( $this->classes[ $parent_slug ][ $slug ] ); |
|
117 | + if (isset($slug)) { |
|
118 | + return isset($this->classes[$parent_slug][$slug]); |
|
119 | 119 | } else { |
120 | - return isset( $this->classes[ $parent_slug ] ); |
|
120 | + return isset($this->classes[$parent_slug]); |
|
121 | 121 | } |
122 | 122 | } |
123 | 123 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | * |
38 | 38 | * @return object[] The child objects, indexed by slug. |
39 | 39 | */ |
40 | - public function get_children( $parent_slug ); |
|
40 | + public function get_children($parent_slug); |
|
41 | 41 | |
42 | 42 | /** |
43 | 43 | * Get an object by its slug. |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * |
50 | 50 | * @return object|false The object or false on failure. |
51 | 51 | */ |
52 | - public function get( $parent_slug, $slug ); |
|
52 | + public function get($parent_slug, $slug); |
|
53 | 53 | |
54 | 54 | /** |
55 | 55 | * Register a type of object. |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * |
64 | 64 | * @return bool Whether the class was registered successfully. |
65 | 65 | */ |
66 | - public function register( $parent_slug, $slug, $class, array $args = array() ); |
|
66 | + public function register($parent_slug, $slug, $class, array $args = array()); |
|
67 | 67 | |
68 | 68 | /** |
69 | 69 | * Deregister a type of object. |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | * @param string $parent_slug The group slug. |
74 | 74 | * @param string $slug The slug of the class to deregister. |
75 | 75 | */ |
76 | - public function deregister( $parent_slug, $slug ); |
|
76 | + public function deregister($parent_slug, $slug); |
|
77 | 77 | |
78 | 78 | /** |
79 | 79 | * Deregister all children of a particular parent. |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * |
83 | 83 | * @param string $parent_slug The group slug. |
84 | 84 | */ |
85 | - public function deregister_children( $parent_slug ); |
|
85 | + public function deregister_children($parent_slug); |
|
86 | 86 | |
87 | 87 | /** |
88 | 88 | * Check if a type of object is registered by its slug. |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | * |
98 | 98 | * @return bool Whether the class is registered. |
99 | 99 | */ |
100 | - public function is_registered( $parent_slug, $slug = null ); |
|
100 | + public function is_registered($parent_slug, $slug = null); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | // EOF |
@@ -29,11 +29,11 @@ discard block |
||
29 | 29 | /** |
30 | 30 | * @since 1.0.0 |
31 | 31 | */ |
32 | - public function get_all( array $args = array() ) { |
|
32 | + public function get_all(array $args = array()) { |
|
33 | 33 | |
34 | - $classes = array_diff_key( $this->classes, $this->objects ); |
|
34 | + $classes = array_diff_key($this->classes, $this->objects); |
|
35 | 35 | |
36 | - if ( ! empty( $classes ) ) { |
|
36 | + if ( ! empty($classes)) { |
|
37 | 37 | |
38 | 38 | $objects = WordPoints_Class_Registry::construct_with_args( |
39 | 39 | $classes |
@@ -49,40 +49,40 @@ discard block |
||
49 | 49 | /** |
50 | 50 | * @since 1.0.0 |
51 | 51 | */ |
52 | - public function get( $slug, array $args = array() ) { |
|
52 | + public function get($slug, array $args = array()) { |
|
53 | 53 | |
54 | - if ( ! isset( $this->objects[ $slug ] ) ) { |
|
54 | + if ( ! isset($this->objects[$slug])) { |
|
55 | 55 | |
56 | - $object = parent::get( $slug, $args ); |
|
56 | + $object = parent::get($slug, $args); |
|
57 | 57 | |
58 | - if ( ! $object ) { |
|
58 | + if ( ! $object) { |
|
59 | 59 | return false; |
60 | 60 | } |
61 | 61 | |
62 | - $this->objects[ $slug ] = $object; |
|
62 | + $this->objects[$slug] = $object; |
|
63 | 63 | } |
64 | 64 | |
65 | - return $this->objects[ $slug ]; |
|
65 | + return $this->objects[$slug]; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
69 | 69 | * @since 1.0.0 |
70 | 70 | */ |
71 | - public function register( $slug, $class, array $args = array() ) { |
|
71 | + public function register($slug, $class, array $args = array()) { |
|
72 | 72 | |
73 | - unset( $this->objects[ $slug ] ); |
|
73 | + unset($this->objects[$slug]); |
|
74 | 74 | |
75 | - return parent::register( $slug, $class, $args ); |
|
75 | + return parent::register($slug, $class, $args); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | /** |
79 | 79 | * @since 1.0.0 |
80 | 80 | */ |
81 | - public function deregister( $slug ) { |
|
81 | + public function deregister($slug) { |
|
82 | 82 | |
83 | - parent::deregister( $slug ); |
|
83 | + parent::deregister($slug); |
|
84 | 84 | |
85 | - unset( $this->objects[ $slug ] ); |
|
85 | + unset($this->objects[$slug]); |
|
86 | 86 | } |
87 | 87 | } |
88 | 88 |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * |
42 | 42 | * @return object|false The object or false if it is not registered. |
43 | 43 | */ |
44 | - public function get( $slug ); |
|
44 | + public function get($slug); |
|
45 | 45 | |
46 | 46 | /** |
47 | 47 | * Register a type of object. |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | * |
55 | 55 | * @return bool Whether the class was registered successfully. |
56 | 56 | */ |
57 | - public function register( $slug, $class, array $args = array() ); |
|
57 | + public function register($slug, $class, array $args = array()); |
|
58 | 58 | |
59 | 59 | /** |
60 | 60 | * Deregister a type of object |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * |
64 | 64 | * @param string $slug The slug of the class to deregister. |
65 | 65 | */ |
66 | - public function deregister( $slug ); |
|
66 | + public function deregister($slug); |
|
67 | 67 | |
68 | 68 | /** |
69 | 69 | * Check if a type of object is registered by its slug. |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | * |
75 | 75 | * @return bool Whether the class is registered. |
76 | 76 | */ |
77 | - public function is_registered( $slug ); |
|
77 | + public function is_registered($slug); |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | // EOF |