Completed
Push — master ( e7ef90...760553 )
by J.D.
03:28
created
src/classes/class/registry/deepi.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
 	 *
29 29
 	 * @return object[] The child objects, indexed by slug.
30 30
 	 */
31
-	public function get_children( array $parent_slugs = array() );
31
+	public function get_children(array $parent_slugs = array());
32 32
 
33 33
 	/**
34 34
 	 * Get the slugs of all of the direct children of a certain parent.
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 	 *
40 40
 	 * @return string[] The child slugs.
41 41
 	 */
42
-	public function get_children_slugs( array $parent_slugs = array() );
42
+	public function get_children_slugs(array $parent_slugs = array());
43 43
 
44 44
 	/**
45 45
 	 * Get an object by its slug.
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	 *
53 53
 	 * @return false|object The object or false on failure.
54 54
 	 */
55
-	public function get( $slug, array $parent_slugs = array() );
55
+	public function get($slug, array $parent_slugs = array());
56 56
 
57 57
 	/**
58 58
 	 * Register a type of object.
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 	 *
67 67
 	 * @return bool Whether the class was registered successfully.
68 68
 	 */
69
-	public function register( $slug, array $parent_slugs, $class, array $args = array() );
69
+	public function register($slug, array $parent_slugs, $class, array $args = array());
70 70
 
71 71
 	/**
72 72
 	 * Deregister a type of object.
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	 * @param string[] $parent_slugs The slug(s) of the class's parent(s) in the
78 78
 	 *                               hierarchy.
79 79
 	 */
80
-	public function deregister( $slug, array $parent_slugs = array() );
80
+	public function deregister($slug, array $parent_slugs = array());
81 81
 
82 82
 	/**
83 83
 	 * Deregister all children of a particular parent in the hierarchy.
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	 *
87 87
 	 * @param string[] $parent_slugs The hierarchy of the parent.
88 88
 	 */
89
-	public function deregister_children( array $parent_slugs = array() );
89
+	public function deregister_children(array $parent_slugs = array());
90 90
 
91 91
 	/**
92 92
 	 * Check if a type of object is registered by its slug.
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	 *
102 102
 	 * @return bool Whether the class is registered.
103 103
 	 */
104
-	public function is_registered( $slug, array $parent_slugs = array() );
104
+	public function is_registered($slug, array $parent_slugs = array());
105 105
 }
106 106
 
107 107
 // EOF
Please login to merge, or discard this patch.
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -32,6 +32,7 @@  discard block
 block discarded – undo
32 32
 	 * @since 2.1.0
33 33
 	 *
34 34
 	 * @param WordPoints_Entity $entity An entity.
35
+	 * @return void
35 36
 	 */
36 37
 	public function add_entity( WordPoints_Entity $entity );
37 38
 
@@ -41,6 +42,7 @@  discard block
 block discarded – undo
41 42
 	 * @since 2.1.0
42 43
 	 *
43 44
 	 * @param string $slug The slug of the entity to remove.
45
+	 * @return void
44 46
 	 */
45 47
 	public function remove_entity( $slug );
46 48
 
Please login to merge, or discard this patch.
src/classes/class/registry/childreni.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	 *
47 47
 	 * @return object[] The child objects, indexed by slug.
48 48
 	 */
49
-	public function get_children( $parent_slug );
49
+	public function get_children($parent_slug);
50 50
 
51 51
 	/**
52 52
 	 * Get the slugs of all of the classes that are children of a certain parent.
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	 *
58 58
 	 * @return string[] The child slugs.
59 59
 	 */
60
-	public function get_children_slugs( $parent_slug );
60
+	public function get_children_slugs($parent_slug);
61 61
 
62 62
 	/**
63 63
 	 * Get an object by its slug.
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 	 *
70 70
 	 * @return object|false The object or false on failure.
71 71
 	 */
72
-	public function get( $parent_slug, $slug );
72
+	public function get($parent_slug, $slug);
73 73
 
74 74
 	/**
75 75
 	 * Register a type of object.
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	 *
84 84
 	 * @return bool Whether the class was registered successfully.
85 85
 	 */
86
-	public function register( $parent_slug, $slug, $class, array $args = array() );
86
+	public function register($parent_slug, $slug, $class, array $args = array());
87 87
 
88 88
 	/**
89 89
 	 * Deregister a type of object.
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 	 * @param string $parent_slug The group slug.
94 94
 	 * @param string $slug        The slug of the class to deregister.
95 95
 	 */
96
-	public function deregister( $parent_slug, $slug );
96
+	public function deregister($parent_slug, $slug);
97 97
 
98 98
 	/**
99 99
 	 * Deregister all children of a particular parent.
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 	 *
103 103
 	 * @param string $parent_slug The group slug.
104 104
 	 */
105
-	public function deregister_children( $parent_slug );
105
+	public function deregister_children($parent_slug);
106 106
 
107 107
 	/**
108 108
 	 * Check if a type of object is registered by its slug.
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 	 *
118 118
 	 * @return bool Whether the class is registered.
119 119
 	 */
120
-	public function is_registered( $parent_slug, $slug = null );
120
+	public function is_registered($parent_slug, $slug = null);
121 121
 }
122 122
 
123 123
 // EOF
Please login to merge, or discard this patch.
Doc Comments   +2 added lines patch added patch discarded remove patch
@@ -32,6 +32,7 @@  discard block
 block discarded – undo
32 32
 	 * @since 2.1.0
33 33
 	 *
34 34
 	 * @param WordPoints_Entity $entity An entity.
35
+	 * @return void
35 36
 	 */
36 37
 	public function add_entity( WordPoints_Entity $entity );
37 38
 
@@ -41,6 +42,7 @@  discard block
 block discarded – undo
41 42
 	 * @since 2.1.0
42 43
 	 *
43 44
 	 * @param string $slug The slug of the entity to remove.
45
+	 * @return void
44 46
 	 */
45 47
 	public function remove_entity( $slug );
46 48
 
Please login to merge, or discard this patch.
src/classes/class/registry/children.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -50,18 +50,18 @@  discard block
 block discarded – undo
50 50
 	/**
51 51
 	 * @since 2.1.0
52 52
 	 */
53
-	public function get_all( array $args = array() ) {
53
+	public function get_all(array $args = array()) {
54 54
 
55 55
 		$items = array();
56 56
 
57
-		if ( $this->settings['pass_slugs'] ) {
58
-			array_unshift( $args, null );
57
+		if ($this->settings['pass_slugs']) {
58
+			array_unshift($args, null);
59 59
 		}
60 60
 
61
-		foreach ( $this->classes as $parent_slug => $classes ) {
62
-			$items[ $parent_slug ] = WordPoints_Class_Registry::construct_with_args(
61
+		foreach ($this->classes as $parent_slug => $classes) {
62
+			$items[$parent_slug] = WordPoints_Class_Registry::construct_with_args(
63 63
 				$classes
64
-				, $this->settings['pass_slugs'] ? array( $parent_slug ) + $args : $args
64
+				, $this->settings['pass_slugs'] ? array($parent_slug) + $args : $args
65 65
 				, $this->settings
66 66
 			);
67 67
 		}
@@ -73,24 +73,24 @@  discard block
 block discarded – undo
73 73
 	 * @since 2.1.0
74 74
 	 */
75 75
 	public function get_all_slugs() {
76
-		return array_map( 'array_keys', $this->classes );
76
+		return array_map('array_keys', $this->classes);
77 77
 	}
78 78
 
79 79
 	/**
80 80
 	 * @since 2.1.0
81 81
 	 */
82
-	public function get_children( $parent_slug, array $args = array() ) {
82
+	public function get_children($parent_slug, array $args = array()) {
83 83
 
84 84
 		$items = array();
85 85
 
86
-		if ( isset( $this->classes[ $parent_slug ] ) ) {
86
+		if (isset($this->classes[$parent_slug])) {
87 87
 
88
-			if ( $this->settings['pass_slugs'] ) {
89
-				array_unshift( $args, $parent_slug );
88
+			if ($this->settings['pass_slugs']) {
89
+				array_unshift($args, $parent_slug);
90 90
 			}
91 91
 
92 92
 			$items = WordPoints_Class_Registry::construct_with_args(
93
-				$this->classes[ $parent_slug ]
93
+				$this->classes[$parent_slug]
94 94
 				, $args
95 95
 				, $this->settings
96 96
 			);
@@ -102,12 +102,12 @@  discard block
 block discarded – undo
102 102
 	/**
103 103
 	 * @since 2.1.0
104 104
 	 */
105
-	public function get_children_slugs( $parent_slug ) {
105
+	public function get_children_slugs($parent_slug) {
106 106
 
107 107
 		$slugs = array();
108 108
 
109
-		if ( isset( $this->classes[ $parent_slug ] ) ) {
110
-			$slugs = array_keys( $this->classes[ $parent_slug ] );
109
+		if (isset($this->classes[$parent_slug])) {
110
+			$slugs = array_keys($this->classes[$parent_slug]);
111 111
 		}
112 112
 
113 113
 		return $slugs;
@@ -116,38 +116,38 @@  discard block
 block discarded – undo
116 116
 	/**
117 117
 	 * @since 2.1.0
118 118
 	 */
119
-	public function get( $parent_slug, $slug, array $args = array() ) {
119
+	public function get($parent_slug, $slug, array $args = array()) {
120 120
 
121
-		if ( ! isset( $this->classes[ $parent_slug ][ $slug ] ) ) {
121
+		if ( ! isset($this->classes[$parent_slug][$slug])) {
122 122
 			return false;
123 123
 		}
124 124
 
125
-		$class = $this->classes[ $parent_slug ][ $slug ];
125
+		$class = $this->classes[$parent_slug][$slug];
126 126
 
127
-		if ( empty( $args ) ) {
127
+		if (empty($args)) {
128 128
 
129
-			if ( $this->settings['pass_slugs'] ) {
130
-				return new $class( $slug, $parent_slug );
129
+			if ($this->settings['pass_slugs']) {
130
+				return new $class($slug, $parent_slug);
131 131
 			} else {
132 132
 				return new $class();
133 133
 			}
134 134
 
135 135
 		} else {
136 136
 
137
-			if ( $this->settings['pass_slugs'] ) {
138
-				array_unshift( $args, $slug, $parent_slug );
137
+			if ($this->settings['pass_slugs']) {
138
+				array_unshift($args, $slug, $parent_slug);
139 139
 			}
140 140
 
141
-			return wordpoints_construct_class_with_args( $class, $args );
141
+			return wordpoints_construct_class_with_args($class, $args);
142 142
 		}
143 143
 	}
144 144
 
145 145
 	/**
146 146
 	 * @since 2.1.0
147 147
 	 */
148
-	public function register( $parent_slug, $slug, $class, array $args = array() ) {
148
+	public function register($parent_slug, $slug, $class, array $args = array()) {
149 149
 
150
-		$this->classes[ $parent_slug ][ $slug ] = $class;
150
+		$this->classes[$parent_slug][$slug] = $class;
151 151
 
152 152
 		return true;
153 153
 	}
@@ -155,26 +155,26 @@  discard block
 block discarded – undo
155 155
 	/**
156 156
 	 * @since 2.1.0
157 157
 	 */
158
-	public function deregister( $parent_slug, $slug ) {
159
-		unset( $this->classes[ $parent_slug ][ $slug ] );
158
+	public function deregister($parent_slug, $slug) {
159
+		unset($this->classes[$parent_slug][$slug]);
160 160
 	}
161 161
 
162 162
 	/**
163 163
 	 * @since 2.1.0
164 164
 	 */
165
-	public function deregister_children( $parent_slug ) {
166
-		unset( $this->classes[ $parent_slug ] );
165
+	public function deregister_children($parent_slug) {
166
+		unset($this->classes[$parent_slug]);
167 167
 	}
168 168
 
169 169
 	/**
170 170
 	 * @since 2.1.0
171 171
 	 */
172
-	public function is_registered( $parent_slug, $slug = null ) {
172
+	public function is_registered($parent_slug, $slug = null) {
173 173
 
174
-		if ( isset( $slug ) ) {
175
-			return isset( $this->classes[ $parent_slug ][ $slug ] );
174
+		if (isset($slug)) {
175
+			return isset($this->classes[$parent_slug][$slug]);
176 176
 		} else {
177
-			return isset( $this->classes[ $parent_slug ] );
177
+			return isset($this->classes[$parent_slug]);
178 178
 		}
179 179
 	}
180 180
 }
Please login to merge, or discard this patch.
src/classes/class/registry/persistent.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -29,11 +29,11 @@  discard block
 block discarded – undo
29 29
 	/**
30 30
 	 * @since 2.1.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
 block discarded – undo
49 49
 	/**
50 50
 	 * @since 2.1.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 2.1.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 2.1.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
 
Please login to merge, or discard this patch.
src/classes/class/registry/deep/multilevel.php 1 patch
Spacing   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -63,14 +63,14 @@  discard block
 block discarded – undo
63 63
 		array $args = array()
64 64
 	) {
65 65
 
66
-		$classes = $this->get_deep( $this->classes, $parent_slugs );
66
+		$classes = $this->get_deep($this->classes, $parent_slugs);
67 67
 
68
-		if ( ! $classes || ! isset( $classes['_classes'] ) ) {
68
+		if ( ! $classes || ! isset($classes['_classes'])) {
69 69
 			return array();
70 70
 		}
71 71
 
72
-		if ( $this->settings['pass_slugs'] ) {
73
-			array_unshift( $args, $parent_slugs );
72
+		if ($this->settings['pass_slugs']) {
73
+			array_unshift($args, $parent_slugs);
74 74
 		}
75 75
 
76 76
 		return WordPoints_Class_Registry::construct_with_args(
@@ -83,14 +83,14 @@  discard block
 block discarded – undo
83 83
 	/**
84 84
 	 * @since 2.2.0
85 85
 	 */
86
-	public function get_children_slugs( array $parent_slugs = array() ) {
86
+	public function get_children_slugs(array $parent_slugs = array()) {
87 87
 
88 88
 		$slugs = array();
89 89
 
90
-		$classes = $this->get_deep( $this->classes, $parent_slugs );
90
+		$classes = $this->get_deep($this->classes, $parent_slugs);
91 91
 
92
-		if ( $classes && isset( $classes['_classes'] ) ) {
93
-			$slugs = array_keys( $classes['_classes'] );
92
+		if ($classes && isset($classes['_classes'])) {
93
+			$slugs = array_keys($classes['_classes']);
94 94
 		}
95 95
 
96 96
 		return $slugs;
@@ -110,29 +110,29 @@  discard block
 block discarded – undo
110 110
 		array $args = array()
111 111
 	) {
112 112
 
113
-		$classes = $this->get_deep( $this->classes, $parent_slugs );
113
+		$classes = $this->get_deep($this->classes, $parent_slugs);
114 114
 
115
-		if ( ! $classes || ! isset( $classes['_classes'][ $slug ] ) ) {
115
+		if ( ! $classes || ! isset($classes['_classes'][$slug])) {
116 116
 			return false;
117 117
 		}
118 118
 
119
-		$class = $classes['_classes'][ $slug ];
119
+		$class = $classes['_classes'][$slug];
120 120
 
121
-		if ( empty( $args ) ) {
121
+		if (empty($args)) {
122 122
 
123
-			if ( $this->settings['pass_slugs'] ) {
124
-				return new $class( $slug, $parent_slugs );
123
+			if ($this->settings['pass_slugs']) {
124
+				return new $class($slug, $parent_slugs);
125 125
 			} else {
126 126
 				return new $class();
127 127
 			}
128 128
 
129 129
 		} else {
130 130
 
131
-			if ( $this->settings['pass_slugs'] ) {
132
-				array_unshift( $args, $slug, $parent_slugs );
131
+			if ($this->settings['pass_slugs']) {
132
+				array_unshift($args, $slug, $parent_slugs);
133 133
 			}
134 134
 
135
-			return wordpoints_construct_class_with_args( $class, $args );
135
+			return wordpoints_construct_class_with_args($class, $args);
136 136
 		}
137 137
 	}
138 138
 
@@ -148,16 +148,16 @@  discard block
 block discarded – undo
148 148
 
149 149
 		$classes = &$this->classes;
150 150
 
151
-		foreach ( $parent_slugs as $parent_slug ) {
151
+		foreach ($parent_slugs as $parent_slug) {
152 152
 
153
-			if ( ! isset( $classes[ $parent_slug ] ) ) {
154
-				$classes[ $parent_slug ] = array();
153
+			if ( ! isset($classes[$parent_slug])) {
154
+				$classes[$parent_slug] = array();
155 155
 			}
156 156
 
157
-			$classes =& $classes[ $parent_slug ];
157
+			$classes = & $classes[$parent_slug];
158 158
 		}
159 159
 
160
-		$classes['_classes'][ $slug ] = $class;
160
+		$classes['_classes'][$slug] = $class;
161 161
 
162 162
 		return true;
163 163
 	}
@@ -165,43 +165,43 @@  discard block
 block discarded – undo
165 165
 	/**
166 166
 	 * @since 2.2.0
167 167
 	 */
168
-	public function deregister( $slug, array $parent_slugs = array() ) {
168
+	public function deregister($slug, array $parent_slugs = array()) {
169 169
 
170
-		$classes = &$this->get_deep( $this->classes, $parent_slugs );
170
+		$classes = &$this->get_deep($this->classes, $parent_slugs);
171 171
 
172
-		if ( ! $classes ) {
172
+		if ( ! $classes) {
173 173
 			return;
174 174
 		}
175 175
 
176
-		unset( $classes['_classes'][ $slug ] );
176
+		unset($classes['_classes'][$slug]);
177 177
 	}
178 178
 
179 179
 	/**
180 180
 	 * @since 2.2.0
181 181
 	 */
182
-	public function deregister_children( array $parent_slugs = array() ) {
182
+	public function deregister_children(array $parent_slugs = array()) {
183 183
 
184
-		$classes = &$this->get_deep( $this->classes, $parent_slugs );
184
+		$classes = &$this->get_deep($this->classes, $parent_slugs);
185 185
 
186
-		if ( ! $classes ) {
186
+		if ( ! $classes) {
187 187
 			return;
188 188
 		}
189 189
 
190
-		unset( $classes['_classes'] );
190
+		unset($classes['_classes']);
191 191
 	}
192 192
 
193 193
 	/**
194 194
 	 * @since 2.2.0
195 195
 	 */
196
-	public function is_registered( $slug, array $parent_slugs = array() ) {
196
+	public function is_registered($slug, array $parent_slugs = array()) {
197 197
 
198 198
 		$parent_slugs[] = '_classes';
199 199
 
200
-		if ( null !== $slug ) {
200
+		if (null !== $slug) {
201 201
 			$parent_slugs[] = $slug;
202 202
 		}
203 203
 
204
-		return (bool) $this->get_deep( $this->classes, $parent_slugs );
204
+		return (bool) $this->get_deep($this->classes, $parent_slugs);
205 205
 	}
206 206
 
207 207
 	/**
@@ -214,19 +214,19 @@  discard block
 block discarded – undo
214 214
 	 *
215 215
 	 * @return mixed|false A reference to the value, or false if not found.
216 216
 	 */
217
-	protected function &get_deep( array &$array, array $indexes ) {
217
+	protected function &get_deep(array &$array, array $indexes) {
218 218
 
219 219
 		// Only variable references can be returned by reference.
220 220
 		$false = false;
221 221
 		$false_reference = &$false;
222 222
 
223
-		foreach ( $indexes as $index ) {
223
+		foreach ($indexes as $index) {
224 224
 
225
-			if ( ! isset( $array[ $index ] ) ) {
225
+			if ( ! isset($array[$index])) {
226 226
 				return $false_reference;
227 227
 			}
228 228
 
229
-			$array = &$array[ $index ];
229
+			$array = &$array[$index];
230 230
 		}
231 231
 
232 232
 		return $array;
Please login to merge, or discard this patch.
src/classes/class/registryi.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	 *
51 51
 	 * @return object|false The object or false if it is not registered.
52 52
 	 */
53
-	public function get( $slug );
53
+	public function get($slug);
54 54
 
55 55
 	/**
56 56
 	 * Register a type of object.
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	 *
64 64
 	 * @return bool Whether the class was registered successfully.
65 65
 	 */
66
-	public function register( $slug, $class, array $args = array() );
66
+	public function register($slug, $class, array $args = array());
67 67
 
68 68
 	/**
69 69
 	 * Deregister a type of object
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
 	 *
73 73
 	 * @param string $slug The slug of the class to deregister.
74 74
 	 */
75
-	public function deregister( $slug );
75
+	public function deregister($slug);
76 76
 
77 77
 	/**
78 78
 	 * Check if a type of object is registered by its slug.
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	 *
84 84
 	 * @return bool Whether the class is registered.
85 85
 	 */
86
-	public function is_registered( $slug );
86
+	public function is_registered($slug);
87 87
 }
88 88
 
89 89
 // EOF
Please login to merge, or discard this patch.
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -18,6 +18,7 @@
 block discarded – undo
18 18
 	 * @since 2.2.0
19 19
 	 *
20 20
 	 * @param object $log The object for the points log the restriction is for.
21
+	 * @return void
21 22
 	 */
22 23
 	public function __construct( $log );
23 24
 
Please login to merge, or discard this patch.
src/classes/class/registry.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -30,46 +30,46 @@  discard block
 block discarded – undo
30 30
 	/**
31 31
 	 * @since 2.1.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 2.1.0
39 39
 	 */
40 40
 	public function get_all_slugs() {
41
-		return array_keys( $this->classes );
41
+		return array_keys($this->classes);
42 42
 	}
43 43
 
44 44
 	/**
45 45
 	 * @since 2.1.0
46 46
 	 */
47
-	public function get( $slug, array $args = array() ) {
47
+	public function get($slug, array $args = array()) {
48 48
 
49
-		if ( ! isset( $this->classes[ $slug ] ) ) {
49
+		if ( ! isset($this->classes[$slug])) {
50 50
 			return false;
51 51
 		}
52 52
 
53
-		if ( ! empty( $args ) ) {
53
+		if ( ! empty($args)) {
54 54
 
55
-			array_unshift( $args, $slug );
55
+			array_unshift($args, $slug);
56 56
 
57 57
 			return wordpoints_construct_class_with_args(
58
-				$this->classes[ $slug ]
58
+				$this->classes[$slug]
59 59
 				, $args
60 60
 			);
61 61
 
62 62
 		} else {
63
-			return new $this->classes[ $slug ]( $slug );
63
+			return new $this->classes[$slug]($slug);
64 64
 		}
65 65
 	}
66 66
 
67 67
 	/**
68 68
 	 * @since 2.1.0
69 69
 	 */
70
-	public function register( $slug, $class, array $args = array() ) {
70
+	public function register($slug, $class, array $args = array()) {
71 71
 
72
-		$this->classes[ $slug ] = $class;
72
+		$this->classes[$slug] = $class;
73 73
 
74 74
 		return true;
75 75
 	}
@@ -77,17 +77,17 @@  discard block
 block discarded – undo
77 77
 	/**
78 78
 	 * @since 2.1.0
79 79
 	 */
80
-	public function deregister( $slug ) {
80
+	public function deregister($slug) {
81 81
 
82
-		unset( $this->classes[ $slug ] );
82
+		unset($this->classes[$slug]);
83 83
 	}
84 84
 
85 85
 	/**
86 86
 	 * @since 2.1.0
87 87
 	 */
88
-	public function is_registered( $slug ) {
88
+	public function is_registered($slug) {
89 89
 
90
-		return isset( $this->classes[ $slug ] );
90
+		return isset($this->classes[$slug]);
91 91
 	}
92 92
 
93 93
 	/**
@@ -114,39 +114,39 @@  discard block
 block discarded – undo
114 114
 		array $args = array()
115 115
 	) {
116 116
 
117
-		$pass_slugs = ( ! isset( $args['pass_slugs'] ) || $args['pass_slugs'] );
117
+		$pass_slugs = ( ! isset($args['pass_slugs']) || $args['pass_slugs']);
118 118
 
119 119
 		$objects = array();
120 120
 
121
-		if ( empty( $construct_with_args ) ) {
121
+		if (empty($construct_with_args)) {
122 122
 
123
-			if ( $pass_slugs ) {
124
-				foreach ( $classes as $slug => $class ) {
125
-					$objects[ $slug ] = new $class( $slug );
123
+			if ($pass_slugs) {
124
+				foreach ($classes as $slug => $class) {
125
+					$objects[$slug] = new $class($slug);
126 126
 				}
127 127
 			} else {
128
-				foreach ( $classes as $slug => $class ) {
129
-					$objects[ $slug ] = new $class();
128
+				foreach ($classes as $slug => $class) {
129
+					$objects[$slug] = new $class();
130 130
 				}
131 131
 			}
132 132
 
133 133
 		} else {
134 134
 
135
-			if ( $pass_slugs ) {
135
+			if ($pass_slugs) {
136 136
 
137
-				array_unshift( $construct_with_args, null );
137
+				array_unshift($construct_with_args, null);
138 138
 
139
-				foreach ( $classes as $slug => $class ) {
140
-					$objects[ $slug ] = wordpoints_construct_class_with_args(
139
+				foreach ($classes as $slug => $class) {
140
+					$objects[$slug] = wordpoints_construct_class_with_args(
141 141
 						$class
142
-						, array( $slug ) + $construct_with_args
142
+						, array($slug) + $construct_with_args
143 143
 					);
144 144
 				}
145 145
 
146 146
 			} else {
147 147
 
148
-				foreach ( $classes as $slug => $class ) {
149
-					$objects[ $slug ] = wordpoints_construct_class_with_args(
148
+				foreach ($classes as $slug => $class) {
149
+					$objects[$slug] = wordpoints_construct_class_with_args(
150 150
 						$class
151 151
 						, $construct_with_args
152 152
 					);
Please login to merge, or discard this patch.
src/classes/entity.php 2 patches
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -108,11 +108,11 @@  discard block
 block discarded – undo
108 108
 	 *
109 109
 	 * @return mixed The entity, or false if not found.
110 110
 	 */
111
-	protected function get_entity( $id ) {
111
+	protected function get_entity($id) {
112 112
 
113
-		$entity = call_user_func( $this->getter, $id );
113
+		$entity = call_user_func($this->getter, $id);
114 114
 
115
-		if ( ! $this->is_entity( $entity ) ) {
115
+		if ( ! $this->is_entity($entity)) {
116 116
 			return false;
117 117
 		}
118 118
 
@@ -128,13 +128,13 @@  discard block
 block discarded – undo
128 128
 	 *
129 129
 	 * @return bool Whether the passed value is an entity.
130 130
 	 */
131
-	protected function is_entity( $entity ) {
131
+	protected function is_entity($entity) {
132 132
 
133
-		if ( ! is_object( $entity ) && ! is_array( $entity ) ) {
133
+		if ( ! is_object($entity) && ! is_array($entity)) {
134 134
 			return false;
135 135
 		}
136 136
 
137
-		return (bool) $this->get_entity_id( $entity );
137
+		return (bool) $this->get_entity_id($entity);
138 138
 	}
139 139
 
140 140
 	/**
@@ -151,16 +151,16 @@  discard block
 block discarded – undo
151 151
 	 *
152 152
 	 * @return mixed The entity, or false if not found.
153 153
 	 */
154
-	protected function get_entity_from_context( $id, $context ) {
154
+	protected function get_entity_from_context($id, $context) {
155 155
 
156 156
 		/** @var WordPoints_Entity_Contexts $contexts */
157
-		$contexts = wordpoints_entities()->get_sub_app( 'contexts' );
157
+		$contexts = wordpoints_entities()->get_sub_app('contexts');
158 158
 
159
-		if ( ! $contexts->switch_to( $context ) ) {
159
+		if ( ! $contexts->switch_to($context)) {
160 160
 			return false;
161 161
 		}
162 162
 
163
-		$entity = $this->get_entity( $id );
163
+		$entity = $this->get_entity($id);
164 164
 
165 165
 		$contexts->switch_back();
166 166
 
@@ -176,13 +176,13 @@  discard block
 block discarded – undo
176 176
 	 *
177 177
 	 * @return bool Whether the passed value is a GUID for an entity of this type.
178 178
 	 */
179
-	protected function is_guid( $guid ) {
179
+	protected function is_guid($guid) {
180 180
 
181
-		if ( ! is_array( $guid ) ) {
181
+		if ( ! is_array($guid)) {
182 182
 			return false;
183 183
 		}
184 184
 
185
-		return isset( $guid[ $this->get_slug() ], $guid[ $this->get_context() ] );
185
+		return isset($guid[$this->get_slug()], $guid[$this->get_context()]);
186 186
 	}
187 187
 
188 188
 	/**
@@ -197,15 +197,15 @@  discard block
 block discarded – undo
197 197
 	 *         @type array      $context The entity context.
198 198
 	 * }
199 199
 	 */
200
-	protected function split_guid( $guid ) {
200
+	protected function split_guid($guid) {
201 201
 
202 202
 		$slug    = $this->get_slug();
203
-		$id      = $guid[ $slug ];
203
+		$id      = $guid[$slug];
204 204
 		$context = $guid;
205 205
 
206
-		unset( $context[ $slug ] );
206
+		unset($context[$slug]);
207 207
 
208
-		return array( 'id' => $id, 'context' => $context );
208
+		return array('id' => $id, 'context' => $context);
209 209
 	}
210 210
 
211 211
 	/**
@@ -218,14 +218,14 @@  discard block
 block discarded – undo
218 218
 	 *
219 219
 	 * @return mixed The value of the attribute of the entity.
220 220
 	 */
221
-	protected function get_attr_value( $entity, $attr ) {
221
+	protected function get_attr_value($entity, $attr) {
222 222
 
223
-		if ( is_array( $entity ) ) {
224
-			if ( isset( $entity[ $attr ] ) ) {
225
-				return $entity[ $attr ];
223
+		if (is_array($entity)) {
224
+			if (isset($entity[$attr])) {
225
+				return $entity[$attr];
226 226
 			}
227 227
 		} else {
228
-			if ( isset( $entity->{$attr} ) ) {
228
+			if (isset($entity->{$attr} )) {
229 229
 				return $entity->{$attr};
230 230
 			}
231 231
 		}
@@ -242,8 +242,8 @@  discard block
 block discarded – undo
242 242
 	 *
243 243
 	 * @return mixed The ID of the entity.
244 244
 	 */
245
-	protected function get_entity_id( $entity ) {
246
-		return $this->get_attr_value( $entity, $this->get_id_field() );
245
+	protected function get_entity_id($entity) {
246
+		return $this->get_attr_value($entity, $this->get_id_field());
247 247
 	}
248 248
 
249 249
 	/**
@@ -259,8 +259,8 @@  discard block
 block discarded – undo
259 259
 	 *
260 260
 	 * @return mixed The human ID of the entity.
261 261
 	 */
262
-	protected function get_entity_human_id( $entity ) {
263
-		return $this->get_attr_value( $entity, $this->human_id_field );
262
+	protected function get_entity_human_id($entity) {
263
+		return $this->get_attr_value($entity, $this->human_id_field);
264 264
 	}
265 265
 
266 266
 	//
@@ -302,15 +302,15 @@  discard block
 block discarded – undo
302 302
 	 *
303 303
 	 * @return string|int|float|false The human identifier for the entity, or false.
304 304
 	 */
305
-	public function get_human_id( $id ) {
305
+	public function get_human_id($id) {
306 306
 
307
-		$entity = $this->get_entity( $id );
307
+		$entity = $this->get_entity($id);
308 308
 
309
-		if ( ! $entity ) {
309
+		if ( ! $entity) {
310 310
 			return false;
311 311
 		}
312 312
 
313
-		return $this->get_entity_human_id( $entity );
313
+		return $this->get_entity_human_id($entity);
314 314
 	}
315 315
 
316 316
 	/**
@@ -322,8 +322,8 @@  discard block
 block discarded – undo
322 322
 	 *
323 323
 	 * @return bool Whether or not an entity with that ID exists.
324 324
 	 */
325
-	public function exists( $id ) {
326
-		return (bool) $this->get_entity( $id );
325
+	public function exists($id) {
326
+		return (bool) $this->get_entity($id);
327 327
 	}
328 328
 
329 329
 	/**
@@ -338,17 +338,17 @@  discard block
 block discarded – undo
338 338
 	 *
339 339
 	 * @return WordPoints_Entityish|false The child's object, or false if not found.
340 340
 	 */
341
-	public function get_child( $child_slug ) {
341
+	public function get_child($child_slug) {
342 342
 
343
-		$children = wordpoints_entities()->get_sub_app( 'children' );
343
+		$children = wordpoints_entities()->get_sub_app('children');
344 344
 
345
-		$child = $children->get( $this->slug, $child_slug );
345
+		$child = $children->get($this->slug, $child_slug);
346 346
 
347 347
 		if (
348
-			isset( $this->the_value )
348
+			isset($this->the_value)
349 349
 			&& $child instanceof WordPoints_Entity_ChildI
350 350
 		) {
351
-			$child->set_the_value_from_entity( $this );
351
+			$child->set_the_value_from_entity($this);
352 352
 		}
353 353
 
354 354
 		return $child;
@@ -371,33 +371,33 @@  discard block
 block discarded – undo
371 371
 	 *
372 372
 	 * @return bool Whether the value was set.
373 373
 	 */
374
-	public function set_the_value( $value ) {
374
+	public function set_the_value($value) {
375 375
 
376 376
 		$this->the_value = $this->the_entity = $this->the_context = null;
377 377
 
378
-		if ( $this->is_entity( $value ) ) {
378
+		if ($this->is_entity($value)) {
379 379
 
380 380
 			$entity = $value;
381
-			$value = $this->get_entity_id( $value );
381
+			$value = $this->get_entity_id($value);
382 382
 
383
-		} elseif ( $this->is_guid( $value ) ) {
383
+		} elseif ($this->is_guid($value)) {
384 384
 
385
-			$guid = $this->split_guid( $value );
385
+			$guid = $this->split_guid($value);
386 386
 			$context = $guid['context'];
387 387
 			$value   = $guid['id'];
388 388
 
389
-			$entity = $this->get_entity_from_context( $guid['id'], $context );
389
+			$entity = $this->get_entity_from_context($guid['id'], $context);
390 390
 
391 391
 		} else {
392 392
 
393
-			$entity = $this->get_entity( $value );
393
+			$entity = $this->get_entity($value);
394 394
 		}
395 395
 
396
-		if ( ! $entity ) {
396
+		if ( ! $entity) {
397 397
 			return false;
398 398
 		}
399 399
 
400
-		if ( ! isset( $context ) ) {
400
+		if ( ! isset($context)) {
401 401
 			$context = wordpoints_entities_get_current_context_id(
402 402
 				$this->get_context()
403 403
 			);
@@ -419,8 +419,8 @@  discard block
 block discarded – undo
419 419
 	 *
420 420
 	 * @return mixed The value of the attribute.
421 421
 	 */
422
-	public function get_the_attr_value( $attr ) {
423
-		return $this->get_attr_value( $this->the_entity, $attr );
422
+	public function get_the_attr_value($attr) {
423
+		return $this->get_attr_value($this->the_entity, $attr);
424 424
 	}
425 425
 
426 426
 	/**
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
 	 * @return string|int|float|null The human identifier for the entity, or null.
445 445
 	 */
446 446
 	public function get_the_human_id() {
447
-		return $this->get_entity_human_id( $this->the_entity );
447
+		return $this->get_entity_human_id($this->the_entity);
448 448
 	}
449 449
 
450 450
 	/**
@@ -478,11 +478,11 @@  discard block
 block discarded – undo
478 478
 
479 479
 		$guid = $this->get_the_context();
480 480
 
481
-		if ( ! is_array( $guid ) ) {
481
+		if ( ! is_array($guid)) {
482 482
 			return $guid;
483 483
 		}
484 484
 
485
-		$guid = array( $this->slug => $this->get_the_id() ) + $guid;
485
+		$guid = array($this->slug => $this->get_the_id()) + $guid;
486 486
 
487 487
 		return $guid;
488 488
 	}
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -430,7 +430,7 @@
 block discarded – undo
430 430
 	 *
431 431
 	 * @since 2.1.0
432 432
 	 *
433
-	 * @return mixed The ID of the entity.
433
+	 * @return integer The ID of the entity.
434 434
 	 */
435 435
 	public function get_the_id() {
436 436
 		return $this->get_the_value();
Please login to merge, or discard this patch.
src/classes/data/typei.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
 	 *
43 43
 	 * @return mixed|WP_Error The validated value or a WP_Error on failure.
44 44
 	 */
45
-	public function validate_value( $value );
45
+	public function validate_value($value);
46 46
 }
47 47
 
48 48
 // EOF
Please login to merge, or discard this patch.