@@ -25,11 +25,11 @@ |
||
25 | 25 | */ |
26 | 26 | public function should_fire() { |
27 | 27 | |
28 | - if ( ! isset( $this->args[1]->comment_approved ) ) { |
|
28 | + if ( ! isset( $this->args[ 1 ]->comment_approved ) ) { |
|
29 | 29 | return false; |
30 | 30 | } |
31 | 31 | |
32 | - if ( 1 !== (int) $this->args[1]->comment_approved ) { |
|
32 | + if ( 1 !== (int) $this->args[ 1 ]->comment_approved ) { |
|
33 | 33 | return false; |
34 | 34 | } |
35 | 35 |
@@ -77,8 +77,8 @@ |
||
77 | 77 | |
78 | 78 | $parts = explode( ':', $slug, 2 ); |
79 | 79 | |
80 | - if ( isset( $parts[1] ) ) { |
|
81 | - $this->entity_slug = $parts[1]; |
|
80 | + if ( isset( $parts[ 1 ] ) ) { |
|
81 | + $this->entity_slug = $parts[ 1 ]; |
|
82 | 82 | } else { |
83 | 83 | $this->entity_slug = $slug; |
84 | 84 | } |
@@ -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 | } |
@@ -77,18 +77,18 @@ discard block |
||
77 | 77 | |
78 | 78 | parent::register( $slug, $class, $args ); |
79 | 79 | |
80 | - if ( isset( $args['actions'] ) ) { |
|
81 | - foreach ( $args['actions'] as $type => $actions ) { |
|
80 | + if ( isset( $args[ 'actions' ] ) ) { |
|
81 | + foreach ( $args[ 'actions' ] as $type => $actions ) { |
|
82 | 82 | foreach ( (array) $actions as $action_slug ) { |
83 | 83 | $this->router->add_event_to_action( $slug, $action_slug, $type ); |
84 | 84 | } |
85 | 85 | } |
86 | 86 | } |
87 | 87 | |
88 | - if ( isset( $args['args'] ) ) { |
|
88 | + if ( isset( $args[ 'args' ] ) ) { |
|
89 | 89 | $args_registry = $this->get_sub_app( 'args' ); |
90 | 90 | |
91 | - foreach ( $args['args'] as $arg_slug => $class ) { |
|
91 | + foreach ( $args[ 'args' ] as $arg_slug => $class ) { |
|
92 | 92 | $args_registry->register( $slug, $arg_slug, $class ); |
93 | 93 | } |
94 | 94 | } |
@@ -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 | } |
@@ -127,7 +127,7 @@ |
||
127 | 127 | |
128 | 128 | $this->table_name = $wpdb->wordpoints_hook_hits; |
129 | 129 | |
130 | - $this->defaults['order_by'] = 'date'; |
|
130 | + $this->defaults[ 'order_by' ] = 'date'; |
|
131 | 131 | |
132 | 132 | parent::__construct( $args ); |
133 | 133 | } |
@@ -111,15 +111,15 @@ discard block |
||
111 | 111 | ) { |
112 | 112 | |
113 | 113 | if ( |
114 | - empty( $settings['target'] ) |
|
115 | - || ! is_array( $settings['target'] ) |
|
114 | + empty( $settings[ 'target' ] ) |
|
115 | + || ! is_array( $settings[ 'target' ] ) |
|
116 | 116 | ) { |
117 | 117 | |
118 | 118 | $validator->add_error( __( 'Invalid target.', 'wordpoints' ), 'target' ); |
119 | 119 | |
120 | 120 | } else { |
121 | 121 | |
122 | - $target = $event_args->get_from_hierarchy( $settings['target'] ); |
|
122 | + $target = $event_args->get_from_hierarchy( $settings[ 'target' ] ); |
|
123 | 123 | |
124 | 124 | if ( |
125 | 125 | ! $target instanceof WordPoints_Entity |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | * @since 2.1.0 |
137 | 137 | */ |
138 | 138 | public function update_settings( WordPoints_Hook_ReactionI $reaction, array $settings ) { |
139 | - $reaction->update_meta( 'target', $settings['target'] ); |
|
139 | + $reaction->update_meta( 'target', $settings[ 'target' ] ); |
|
140 | 140 | } |
141 | 141 | } |
142 | 142 |
@@ -48,8 +48,8 @@ |
||
48 | 48 | |
49 | 49 | $parts = wordpoints_parse_dynamic_slug( $this->slug ); |
50 | 50 | |
51 | - if ( $parts['dynamic'] ) { |
|
52 | - $entity_slug = "{$this->generic_entity_slug}\\{$parts['dynamic']}"; |
|
51 | + if ( $parts[ 'dynamic' ] ) { |
|
52 | + $entity_slug = "{$this->generic_entity_slug}\\{$parts[ 'dynamic' ]}"; |
|
53 | 53 | } else { |
54 | 54 | $entity_slug = $this->generic_entity_slug; |
55 | 55 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | $parsed = wordpoints_parse_dynamic_slug( $this->slug ); |
30 | 30 | |
31 | - switch ( $parsed['dynamic'] ) { |
|
31 | + switch ( $parsed[ 'dynamic' ] ) { |
|
32 | 32 | |
33 | 33 | case 'post': |
34 | 34 | return __( 'Publish Post', 'wordpoints' ); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | $parsed = wordpoints_parse_dynamic_slug( $this->slug ); |
54 | 54 | |
55 | - switch ( $parsed['dynamic'] ) { |
|
55 | + switch ( $parsed[ 'dynamic' ] ) { |
|
56 | 56 | |
57 | 57 | case 'post': |
58 | 58 | return __( 'When a Post is published.', 'wordpoints' ); |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | |
77 | 77 | $parsed = wordpoints_parse_dynamic_slug( $this->slug ); |
78 | 78 | |
79 | - switch ( $parsed['dynamic'] ) { |
|
79 | + switch ( $parsed[ 'dynamic' ] ) { |
|
80 | 80 | |
81 | 81 | case 'post': |
82 | 82 | return __( 'Post removed.', 'wordpoints' ); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | $parsed = wordpoints_parse_dynamic_slug( $this->slug ); |
30 | 30 | |
31 | - switch ( $parsed['dynamic'] ) { |
|
31 | + switch ( $parsed[ 'dynamic' ] ) { |
|
32 | 32 | |
33 | 33 | case 'post': |
34 | 34 | return __( 'Comment on a Post', 'wordpoints' ); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | $parsed = wordpoints_parse_dynamic_slug( $this->slug ); |
57 | 57 | |
58 | - switch ( $parsed['dynamic'] ) { |
|
58 | + switch ( $parsed[ 'dynamic' ] ) { |
|
59 | 59 | |
60 | 60 | case 'post': |
61 | 61 | return __( 'When a user leaves a comment on a Post.', 'wordpoints' ); |