@@ -57,10 +57,10 @@ |
||
| 57 | 57 | if ( is_array( $entity_id ) ) { |
| 58 | 58 | |
| 59 | 59 | $context = $entity_id; |
| 60 | - $entity_slug = $hierarchy[ $depth - ( $depth % 2 ? 1 : 2 ) ]; |
|
| 61 | - $entity_id = $context[ $entity_slug ]; |
|
| 60 | + $entity_slug = $hierarchy[$depth - ( $depth % 2 ? 1 : 2 )]; |
|
| 61 | + $entity_id = $context[$entity_slug]; |
|
| 62 | 62 | |
| 63 | - unset( $context[ $entity_slug ] ); |
|
| 63 | + unset( $context[$entity_slug] ); |
|
| 64 | 64 | |
| 65 | 65 | /** @var WordPoints_Entity_Contexts $contexts */ |
| 66 | 66 | $contexts = wordpoints_entities()->get_sub_app( 'contexts' ); |
@@ -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 ) ) { |
@@ -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 | ); |