@@ -363,11 +363,11 @@ |
||
| 363 | 363 | */ |
| 364 | 364 | public function get_meta( $key ) { |
| 365 | 365 | |
| 366 | - if ( ! isset( $this->settings[ $key ] ) ) { |
|
| 366 | + if ( ! isset( $this->settings[$key] ) ) { |
|
| 367 | 367 | return null; |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | - return $this->settings[ $key ]; |
|
| 370 | + return $this->settings[$key]; |
|
| 371 | 371 | } |
| 372 | 372 | |
| 373 | 373 | /** |
@@ -100,11 +100,11 @@ discard block |
||
| 100 | 100 | |
| 101 | 101 | $index = $this->get_reaction_index(); |
| 102 | 102 | |
| 103 | - if ( ! isset( $index[ $id ]['event'] ) ) { |
|
| 103 | + if ( ! isset( $index[$id]['event'] ) ) { |
|
| 104 | 104 | return false; |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | - return $index[ $id ]['event']; |
|
| 107 | + return $index[$id]['event']; |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
@@ -123,11 +123,11 @@ discard block |
||
| 123 | 123 | |
| 124 | 124 | $index = $this->get_reaction_index(); |
| 125 | 125 | |
| 126 | - if ( ! isset( $index[ $id ] ) ) { |
|
| 126 | + if ( ! isset( $index[$id] ) ) { |
|
| 127 | 127 | return false; |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | - $index[ $id ]['event'] = $event; |
|
| 130 | + $index[$id]['event'] = $event; |
|
| 131 | 131 | |
| 132 | 132 | return $this->update_reaction_index( $index ); |
| 133 | 133 | } |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | |
| 177 | 177 | $index = $this->get_reaction_index(); |
| 178 | 178 | |
| 179 | - unset( $index[ $id ] ); |
|
| 179 | + unset( $index[$id] ); |
|
| 180 | 180 | |
| 181 | 181 | return $this->update_reaction_index( $index ); |
| 182 | 182 | } |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | return false; |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | - $index[ $id ] = array( 'event' => $event_slug, 'id' => $id ); |
|
| 204 | + $index[$id] = array( 'event' => $event_slug, 'id' => $id ); |
|
| 205 | 205 | |
| 206 | 206 | if ( ! $this->update_reaction_index( $index ) ) { |
| 207 | 207 | return false; |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | WordPoints_Hook_Event_Args $event_args |
| 71 | 71 | ) { |
| 72 | 72 | |
| 73 | - if ( ! isset( $settings[ $this->slug ] ) ) { |
|
| 73 | + if ( ! isset( $settings[$this->slug] ) ) { |
|
| 74 | 74 | return $settings; |
| 75 | 75 | } |
| 76 | 76 | |
@@ -80,15 +80,15 @@ discard block |
||
| 80 | 80 | $this->validator->push_field( $this->slug ); |
| 81 | 81 | |
| 82 | 82 | $validated_settings = $this->validate_extension_settings( |
| 83 | - $settings[ $this->slug ] |
|
| 83 | + $settings[$this->slug] |
|
| 84 | 84 | ); |
| 85 | 85 | |
| 86 | 86 | $this->validator->pop_field(); |
| 87 | 87 | |
| 88 | 88 | if ( null !== $validated_settings ) { |
| 89 | - $settings[ $this->slug ] = $validated_settings; |
|
| 89 | + $settings[$this->slug] = $validated_settings; |
|
| 90 | 90 | } else { |
| 91 | - unset( $settings[ $this->slug ] ); |
|
| 91 | + unset( $settings[$this->slug] ); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | return $settings; |
@@ -126,9 +126,9 @@ discard block |
||
| 126 | 126 | ); |
| 127 | 127 | |
| 128 | 128 | if ( null !== $validated_settings ) { |
| 129 | - $settings[ $action_type ] = $validated_settings; |
|
| 129 | + $settings[$action_type] = $validated_settings; |
|
| 130 | 130 | } else { |
| 131 | - unset( $settings[ $action_type ] ); |
|
| 131 | + unset( $settings[$action_type] ); |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | $this->validator->pop_field(); |
@@ -142,8 +142,8 @@ discard block |
||
| 142 | 142 | */ |
| 143 | 143 | public function update_settings( WordPoints_Hook_ReactionI $reaction, array $settings ) { |
| 144 | 144 | |
| 145 | - if ( isset( $settings[ $this->slug ] ) ) { |
|
| 146 | - $reaction->update_meta( $this->slug, $settings[ $this->slug ] ); |
|
| 145 | + if ( isset( $settings[$this->slug] ) ) { |
|
| 146 | + $reaction->update_meta( $this->slug, $settings[$this->slug] ); |
|
| 147 | 147 | } else { |
| 148 | 148 | $reaction->delete_meta( $this->slug ); |
| 149 | 149 | } |
@@ -185,8 +185,8 @@ discard block |
||
| 185 | 185 | return $settings; |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | - if ( isset( $settings[ $fire->action_type ] ) ) { |
|
| 189 | - return $settings[ $fire->action_type ]; |
|
| 188 | + if ( isset( $settings[$fire->action_type] ) ) { |
|
| 189 | + return $settings[$fire->action_type]; |
|
| 190 | 190 | } else { |
| 191 | 191 | return false; |
| 192 | 192 | } |
@@ -41,10 +41,10 @@ discard block |
||
| 41 | 41 | $period_units = array( |
| 42 | 42 | 1 => __( 'Seconds', 'wordpoints' ), |
| 43 | 43 | MINUTE_IN_SECONDS => __( 'Minutes', 'wordpoints' ), |
| 44 | - HOUR_IN_SECONDS => __( 'Hours' , 'wordpoints' ), |
|
| 45 | - DAY_IN_SECONDS => __( 'Days' , 'wordpoints' ), |
|
| 46 | - WEEK_IN_SECONDS => __( 'Weeks' , 'wordpoints' ), |
|
| 47 | - 30 * DAY_IN_SECONDS => __( 'Months' , 'wordpoints' ), |
|
| 44 | + HOUR_IN_SECONDS => __( 'Hours', 'wordpoints' ), |
|
| 45 | + DAY_IN_SECONDS => __( 'Days', 'wordpoints' ), |
|
| 46 | + WEEK_IN_SECONDS => __( 'Weeks', 'wordpoints' ), |
|
| 47 | + 30 * DAY_IN_SECONDS => __( 'Months', 'wordpoints' ), |
|
| 48 | 48 | ); |
| 49 | 49 | |
| 50 | 50 | /** |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | $period = $this->validate_period( $period ); |
| 95 | 95 | |
| 96 | 96 | if ( $period ) { |
| 97 | - $periods[ $index ] = $period; |
|
| 97 | + $periods[$index] = $period; |
|
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | $this->validator->pop_field(); |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | continue; |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | - $values[ implode( '.', $arg_hierarchy ) ] = $arg->get_the_value(); |
|
| 278 | + $values[implode( '.', $arg_hierarchy )] = $arg->get_the_value(); |
|
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | ksort( $values ); |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | continue; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - $conditions_data[ $data_type ][ $slug ] = array( |
|
| 57 | + $conditions_data[$data_type][$slug] = array( |
|
| 58 | 58 | 'slug' => $slug, |
| 59 | 59 | 'data_type' => $data_type, |
| 60 | 60 | 'title' => $condition->get_title(), |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $condition = $this->validate_condition( $settings ); |
| 119 | 119 | |
| 120 | 120 | if ( $condition ) { |
| 121 | - $sub_args[ $index ] = $condition; |
|
| 121 | + $sub_args[$index] = $condition; |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | $this->validator->pop_field(); |
@@ -134,12 +134,12 @@ discard block |
||
| 134 | 134 | |
| 135 | 135 | $sub_args = $this->validate_action_type_settings( $sub_args ); |
| 136 | 136 | |
| 137 | - $conditions[ $arg_slug ] = $sub_args; |
|
| 137 | + $conditions[$arg_slug] = $sub_args; |
|
| 138 | 138 | |
| 139 | 139 | $this->event_args->ascend(); |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | - $conditions[ $arg_slug ] = $sub_args; |
|
| 142 | + $conditions[$arg_slug] = $sub_args; |
|
| 143 | 143 | |
| 144 | 144 | } // End foreach ( $conditions ). |
| 145 | 145 | |
@@ -77,8 +77,8 @@ discard block |
||
| 77 | 77 | |
| 78 | 78 | // We cache these so that we don't run the query both before and after the |
| 79 | 79 | // fire. |
| 80 | - if ( isset( $fire->data[ $this->slug ]['hit_ids'] ) ) { |
|
| 81 | - return $fire->data[ $this->slug ]['hit_ids']; |
|
| 80 | + if ( isset( $fire->data[$this->slug]['hit_ids'] ) ) { |
|
| 81 | + return $fire->data[$this->slug]['hit_ids']; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | $query = $fire->get_matching_hits_query(); |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $ids = array(); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - $fire->data[ $this->slug ]['hit_ids'] = $ids; |
|
| 101 | + $fire->data[$this->slug]['hit_ids'] = $ids; |
|
| 102 | 102 | |
| 103 | 103 | return $ids; |
| 104 | 104 | } |
@@ -86,14 +86,14 @@ discard block |
||
| 86 | 86 | continue; |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | - $this->entities[ $slug ] = $entity; |
|
| 89 | + $this->entities[$slug] = $entity; |
|
| 90 | 90 | |
| 91 | 91 | if ( ! $arg->is_stateful() ) { |
| 92 | 92 | |
| 93 | 93 | // If any of the args aren't stateful the event isn't repeatable. |
| 94 | 94 | $this->is_repeatable = false; |
| 95 | 95 | |
| 96 | - $this->signature_args[ $slug ] = $entity; |
|
| 96 | + $this->signature_args[$slug] = $entity; |
|
| 97 | 97 | |
| 98 | 98 | // Back-compat. Some events have multiple "primary" args. |
| 99 | 99 | if ( ! $this->primary_arg_slug ) { |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | return false; |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | - return $this->entities[ $this->primary_arg_slug ]; |
|
| 163 | + return $this->entities[$this->primary_arg_slug]; |
|
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | /** |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | */ |
| 115 | 115 | protected function route_action( $name, $args ) { |
| 116 | 116 | |
| 117 | - if ( ! isset( $this->action_index[ $name ] ) ) { |
|
| 117 | + if ( ! isset( $this->action_index[$name] ) ) { |
|
| 118 | 118 | return; |
| 119 | 119 | } |
| 120 | 120 | |
@@ -132,9 +132,9 @@ discard block |
||
| 132 | 132 | $this->event_args = $this->events->get_sub_app( 'args' ); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | - foreach ( $this->action_index[ $name ]['actions'] as $slug => $data ) { |
|
| 135 | + foreach ( $this->action_index[$name]['actions'] as $slug => $data ) { |
|
| 136 | 136 | |
| 137 | - if ( ! isset( $this->event_index[ $slug ] ) ) { |
|
| 137 | + if ( ! isset( $this->event_index[$slug] ) ) { |
|
| 138 | 138 | continue; |
| 139 | 139 | } |
| 140 | 140 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | continue; |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | - foreach ( $this->event_index[ $slug ] as $type => $events ) { |
|
| 151 | + foreach ( $this->event_index[$slug] as $type => $events ) { |
|
| 152 | 152 | foreach ( $events as $event_slug => $unused ) { |
| 153 | 153 | |
| 154 | 154 | if ( ! $this->events->is_registered( $event_slug ) ) { |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | |
| 206 | 206 | $method = "{$args['action']},{$priority}"; |
| 207 | 207 | |
| 208 | - $this->action_index[ $method ]['actions'][ $slug ] = array(); |
|
| 208 | + $this->action_index[$method]['actions'][$slug] = array(); |
|
| 209 | 209 | |
| 210 | 210 | $arg_number = 1; |
| 211 | 211 | |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | } |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | - $this->action_index[ $method ]['actions'][ $slug ] = $args['data']; |
|
| 226 | + $this->action_index[$method]['actions'][$slug] = $args['data']; |
|
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | if ( isset( $args['arg_number'] ) ) { |
@@ -233,13 +233,13 @@ discard block |
||
| 233 | 233 | // If this action is already being routed, and will have enough args, we |
| 234 | 234 | // don't need to hook to it again. |
| 235 | 235 | if ( |
| 236 | - isset( $this->action_index[ $method ]['arg_number'] ) |
|
| 237 | - && $this->action_index[ $method ]['arg_number'] >= $arg_number |
|
| 236 | + isset( $this->action_index[$method]['arg_number'] ) |
|
| 237 | + && $this->action_index[$method]['arg_number'] >= $arg_number |
|
| 238 | 238 | ) { |
| 239 | 239 | return; |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | - $this->action_index[ $method ]['arg_number'] = $arg_number; |
|
| 242 | + $this->action_index[$method]['arg_number'] = $arg_number; |
|
| 243 | 243 | |
| 244 | 244 | add_action( $args['action'], array( $this, $method ), $priority, $arg_number ); |
| 245 | 245 | } |
@@ -254,13 +254,13 @@ discard block |
||
| 254 | 254 | public function remove_action( $slug ) { |
| 255 | 255 | |
| 256 | 256 | foreach ( $this->action_index as $method => $data ) { |
| 257 | - if ( isset( $data['actions'][ $slug ] ) ) { |
|
| 257 | + if ( isset( $data['actions'][$slug] ) ) { |
|
| 258 | 258 | |
| 259 | - unset( $this->action_index[ $method ]['actions'][ $slug ] ); |
|
| 259 | + unset( $this->action_index[$method]['actions'][$slug] ); |
|
| 260 | 260 | |
| 261 | - if ( empty( $this->action_index[ $method ]['actions'] ) ) { |
|
| 261 | + if ( empty( $this->action_index[$method]['actions'] ) ) { |
|
| 262 | 262 | |
| 263 | - unset( $this->action_index[ $method ] ); |
|
| 263 | + unset( $this->action_index[$method] ); |
|
| 264 | 264 | |
| 265 | 265 | list( $action, $priority ) = explode( ',', $method ); |
| 266 | 266 | |
@@ -280,7 +280,7 @@ discard block |
||
| 280 | 280 | * @param string $action_type The type of action. Default is 'fire'. |
| 281 | 281 | */ |
| 282 | 282 | public function add_event_to_action( $event_slug, $action_slug, $action_type = 'fire' ) { |
| 283 | - $this->event_index[ $action_slug ][ $action_type ][ $event_slug ] = true; |
|
| 283 | + $this->event_index[$action_slug][$action_type][$event_slug] = true; |
|
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | /** |
@@ -293,7 +293,7 @@ discard block |
||
| 293 | 293 | * @param string $action_type The type of action. Default is 'fire'. |
| 294 | 294 | */ |
| 295 | 295 | public function remove_event_from_action( $event_slug, $action_slug, $action_type = 'fire' ) { |
| 296 | - unset( $this->event_index[ $action_slug ][ $action_type ][ $event_slug ] ); |
|
| 296 | + unset( $this->event_index[$action_slug][$action_type][$event_slug] ); |
|
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | /** |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | - $this->event_data[ $slug ] = $args; |
|
| 96 | + $this->event_data[$slug] = $args; |
|
| 97 | 97 | |
| 98 | 98 | return true; |
| 99 | 99 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | parent::deregister( $slug ); |
| 111 | 111 | |
| 112 | - foreach ( (array) $this->event_data[ $slug ]['actions'] as $type => $actions ) { |
|
| 112 | + foreach ( (array) $this->event_data[$slug]['actions'] as $type => $actions ) { |
|
| 113 | 113 | foreach ( (array) $actions as $action_slug ) { |
| 114 | 114 | $this->router->remove_event_from_action( $slug, $action_slug, $type ); |
| 115 | 115 | } |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | |
| 118 | 118 | $this->get_sub_app( 'args' )->deregister_children( $slug ); |
| 119 | 119 | |
| 120 | - unset( $this->event_data[ $slug ] ); |
|
| 120 | + unset( $this->event_data[$slug] ); |
|
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | 123 | |