@@ -33,11 +33,11 @@ |
||
33 | 33 | |
34 | 34 | $names = wp_roles()->get_names(); |
35 | 35 | |
36 | - if ( ! isset( $names[ $entity->name ] ) ) { |
|
36 | + if ( ! isset( $names[$entity->name] ) ) { |
|
37 | 37 | return false; |
38 | 38 | } |
39 | 39 | |
40 | - return translate_user_role( $names[ $entity->name ] ); |
|
40 | + return translate_user_role( $names[$entity->name] ); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function add_entity( WordPoints_Entity $entity ) { |
68 | 68 | |
69 | - $this->entities[ $entity->get_slug() ] = $entity; |
|
69 | + $this->entities[$entity->get_slug()] = $entity; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | /** |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | */ |
75 | 75 | public function remove_entity( $slug ) { |
76 | 76 | |
77 | - unset( $this->entities[ $slug ] ); |
|
77 | + unset( $this->entities[$slug] ); |
|
78 | 78 | |
79 | 79 | if ( |
80 | 80 | isset( $this->hierarchy[0] ) |
@@ -92,11 +92,11 @@ discard block |
||
92 | 92 | |
93 | 93 | if ( ! $this->current ) { |
94 | 94 | |
95 | - if ( ! isset( $this->entities[ $child_slug ] ) ) { |
|
95 | + if ( ! isset( $this->entities[$child_slug] ) ) { |
|
96 | 96 | return false; |
97 | 97 | } |
98 | 98 | |
99 | - $child = $this->entities[ $child_slug ]; |
|
99 | + $child = $this->entities[$child_slug]; |
|
100 | 100 | |
101 | 101 | } else { |
102 | 102 |
@@ -152,7 +152,7 @@ |
||
152 | 152 | continue; |
153 | 153 | } |
154 | 154 | |
155 | - $stores[ $mode ] = $store; |
|
155 | + $stores[$mode] = $store; |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | return $stores; |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | foreach ( $modules as $module ) { |
182 | 182 | if ( ! $this->check_module( $module ) ) { |
183 | 183 | $incompatible_modules[] = $module; |
184 | - $this->checked_modules[ $module ] = false; |
|
184 | + $this->checked_modules[$module] = false; |
|
185 | 185 | } |
186 | 186 | } |
187 | 187 | |
@@ -207,11 +207,11 @@ discard block |
||
207 | 207 | |
208 | 208 | foreach ( $modules as $index => $module ) { |
209 | 209 | |
210 | - if ( isset( $this->checked_modules[ $module ] ) ) { |
|
210 | + if ( isset( $this->checked_modules[$module] ) ) { |
|
211 | 211 | |
212 | - unset( $modules[ $index ] ); |
|
212 | + unset( $modules[$index] ); |
|
213 | 213 | |
214 | - if ( ! $this->checked_modules[ $module ] ) { |
|
214 | + if ( ! $this->checked_modules[$module] ) { |
|
215 | 215 | $incompatible[] = $module; |
216 | 216 | } |
217 | 217 | } |
@@ -219,10 +219,10 @@ discard block |
||
219 | 219 | $valid = wordpoints_validate_module( $module ); |
220 | 220 | |
221 | 221 | if ( is_wp_error( $valid ) ) { |
222 | - unset( $modules[ $index ] ); |
|
222 | + unset( $modules[$index] ); |
|
223 | 223 | } |
224 | 224 | |
225 | - $this->checked_modules[ $module ] = true; |
|
225 | + $this->checked_modules[$module] = true; |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | if ( ! empty( $incompatible ) ) { |
@@ -119,8 +119,8 @@ |
||
119 | 119 | |
120 | 120 | if ( isset( $this->args['values_key'], $this->args['options_key'] ) ) { |
121 | 121 | $option = (array) $option; |
122 | - $value = $option[ $this->args['values_key'] ]; |
|
123 | - $option = $option[ $this->args['options_key'] ]; |
|
122 | + $value = $option[$this->args['values_key']]; |
|
123 | + $option = $option[$this->args['options_key']]; |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | echo '<option value="', esc_attr( $value ), '"', selected( $value, $this->args['selected'], false ), '>', esc_html( $option ), '</option>'; |
@@ -80,9 +80,9 @@ |
||
80 | 80 | foreach ( $guids as $entity_slug => $id ) { |
81 | 81 | |
82 | 82 | if ( $entity_slug === $slug && is_string( $id ) ) { |
83 | - $guids[ $entity_slug ] = (int) $id; |
|
83 | + $guids[$entity_slug] = (int) $id; |
|
84 | 84 | } elseif ( is_array( $id ) ) { |
85 | - $guids[ $entity_slug ] = $this->fix_guid_types( $id, $slug ); |
|
85 | + $guids[$entity_slug] = $this->fix_guid_types( $id, $slug ); |
|
86 | 86 | } |
87 | 87 | } |
88 | 88 |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | foreach ( $extensions as $extension ) { |
194 | 194 | if ( ! $this->check_extension( $extension ) ) { |
195 | 195 | $incompatible_extensions[] = $extension; |
196 | - $this->checked_extensions[ $extension ] = false; |
|
196 | + $this->checked_extensions[$extension] = false; |
|
197 | 197 | } |
198 | 198 | } |
199 | 199 | |
@@ -219,11 +219,11 @@ discard block |
||
219 | 219 | |
220 | 220 | foreach ( $extensions as $index => $extension ) { |
221 | 221 | |
222 | - if ( isset( $this->checked_extensions[ $extension ] ) ) { |
|
222 | + if ( isset( $this->checked_extensions[$extension] ) ) { |
|
223 | 223 | |
224 | - unset( $extensions[ $index ] ); |
|
224 | + unset( $extensions[$index] ); |
|
225 | 225 | |
226 | - if ( ! $this->checked_extensions[ $extension ] ) { |
|
226 | + if ( ! $this->checked_extensions[$extension] ) { |
|
227 | 227 | $incompatible[] = $extension; |
228 | 228 | } |
229 | 229 | } |
@@ -231,10 +231,10 @@ discard block |
||
231 | 231 | $valid = wordpoints_validate_module( $extension ); |
232 | 232 | |
233 | 233 | if ( is_wp_error( $valid ) ) { |
234 | - unset( $extensions[ $index ] ); |
|
234 | + unset( $extensions[$index] ); |
|
235 | 235 | } |
236 | 236 | |
237 | - $this->checked_extensions[ $extension ] = true; |
|
237 | + $this->checked_extensions[$extension] = true; |
|
238 | 238 | } |
239 | 239 | |
240 | 240 | if ( ! empty( $incompatible ) ) { |
@@ -196,8 +196,8 @@ discard block |
||
196 | 196 | $context = $this->get_context(); |
197 | 197 | |
198 | 198 | return ( |
199 | - isset( $guid[ $this->get_slug() ] ) |
|
200 | - && ( '' === $context || isset( $guid[ $context ] ) ) |
|
199 | + isset( $guid[$this->get_slug()] ) |
|
200 | + && ( '' === $context || isset( $guid[$context] ) ) |
|
201 | 201 | ); |
202 | 202 | } |
203 | 203 | |
@@ -216,10 +216,10 @@ discard block |
||
216 | 216 | protected function split_guid( $guid ) { |
217 | 217 | |
218 | 218 | $slug = $this->get_slug(); |
219 | - $id = $guid[ $slug ]; |
|
219 | + $id = $guid[$slug]; |
|
220 | 220 | $context = $guid; |
221 | 221 | |
222 | - unset( $context[ $slug ] ); |
|
222 | + unset( $context[$slug] ); |
|
223 | 223 | |
224 | 224 | return array( 'id' => $id, 'context' => $context ); |
225 | 225 | } |
@@ -237,8 +237,8 @@ discard block |
||
237 | 237 | protected function get_attr_value( $entity, $attr ) { |
238 | 238 | |
239 | 239 | if ( is_array( $entity ) ) { |
240 | - if ( isset( $entity[ $attr ] ) ) { |
|
241 | - return $entity[ $attr ]; |
|
240 | + if ( isset( $entity[$attr] ) ) { |
|
241 | + return $entity[$attr]; |
|
242 | 242 | } |
243 | 243 | } else { |
244 | 244 | if ( isset( $entity->{$attr} ) ) { |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 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 | |
@@ -55,12 +55,12 @@ discard block |
||
55 | 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 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 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 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function deregister( $slug ) { |
81 | 81 | |
82 | - unset( $this->classes[ $slug ] ); |
|
82 | + unset( $this->classes[$slug] ); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 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 | /** |
@@ -122,11 +122,11 @@ discard block |
||
122 | 122 | |
123 | 123 | if ( $pass_slugs ) { |
124 | 124 | foreach ( $classes as $slug => $class ) { |
125 | - $objects[ $slug ] = new $class( $slug ); |
|
125 | + $objects[$slug] = new $class( $slug ); |
|
126 | 126 | } |
127 | 127 | } else { |
128 | 128 | foreach ( $classes as $slug => $class ) { |
129 | - $objects[ $slug ] = new $class(); |
|
129 | + $objects[$slug] = new $class(); |
|
130 | 130 | } |
131 | 131 | } |
132 | 132 | |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | array_unshift( $construct_with_args, null ); |
138 | 138 | |
139 | 139 | foreach ( $classes as $slug => $class ) { |
140 | - $objects[ $slug ] = wordpoints_construct_class_with_args( |
|
140 | + $objects[$slug] = wordpoints_construct_class_with_args( |
|
141 | 141 | $class |
142 | 142 | , array( $slug ) + $construct_with_args |
143 | 143 | ); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | } else { |
147 | 147 | |
148 | 148 | foreach ( $classes as $slug => $class ) { |
149 | - $objects[ $slug ] = wordpoints_construct_class_with_args( |
|
149 | + $objects[$slug] = wordpoints_construct_class_with_args( |
|
150 | 150 | $class |
151 | 151 | , $construct_with_args |
152 | 152 | ); |