Completed
Push — master ( 6935f1...71ff66 )
by J.D.
05:00
created
src/classes/hook/extension/reversals.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -77,8 +77,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.
src/classes/hook/events.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -77,18 +77,18 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 			}
Please login to merge, or discard this patch.
src/classes/hook/hit/query.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -127,7 +127,7 @@
 block discarded – undo
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
 	}
Please login to merge, or discard this patch.
src/classes/hook/reactor.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -111,15 +111,15 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/classes/hook/event/dynamic.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,8 +48,8 @@
 block discarded – undo
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
 		}
Please login to merge, or discard this patch.
src/classes/hook/event/post/publish.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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' );
Please login to merge, or discard this patch.
src/classes/hook/event/comment/leave.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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' );
Please login to merge, or discard this patch.
src/classes/hook/condition.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
 		WordPoints_Hook_Reaction_Validator $validator
24 24
 	) {
25 25
 
26
-		if ( ! isset( $settings['value'] ) || '' === $settings['value'] ) {
26
+		if ( ! isset( $settings[ 'value' ] ) || '' === $settings[ 'value' ] ) {
27 27
 
28 28
 			$settings_fields = $this->get_settings_fields();
29 29
 
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 				sprintf(
32 32
 					// translators: Form field name.
33 33
 					__( '%s is required.', 'wordpoints' )
34
-					, $settings_fields['value']['label']
34
+					, $settings_fields[ 'value' ][ 'label' ]
35 35
 				)
36 36
 				, 'value'
37 37
 			);
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 				return $settings;
49 49
 			}
50 50
 
51
-			$validated_value = $data_type->validate_value( $settings['value'] );
51
+			$validated_value = $data_type->validate_value( $settings[ 'value' ] );
52 52
 
53 53
 			if ( is_wp_error( $validated_value ) ) {
54 54
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 				$validator->add_error(
58 58
 					sprintf(
59 59
 						$validated_value->get_error_message()
60
-						, $settings_fields['value']['label']
60
+						, $settings_fields[ 'value' ][ 'label' ]
61 61
 					)
62 62
 					, 'value'
63 63
 				);
@@ -65,17 +65,17 @@  discard block
 block discarded – undo
65 65
 				return $settings;
66 66
 			}
67 67
 
68
-			$settings['value'] = $validated_value;
68
+			$settings[ 'value' ] = $validated_value;
69 69
 
70 70
 		} elseif ( $arg instanceof WordPoints_Entity ) {
71 71
 
72
-			if ( ! $arg->exists( $settings['value'] ) ) {
72
+			if ( ! $arg->exists( $settings[ 'value' ] ) ) {
73 73
 				$validator->add_error(
74 74
 					sprintf(
75 75
 						// translators: 1. Singular item type name; 2. Item ID/slug.
76 76
 						__( '%1$s “%2$s” not found.', 'wordpoints' )
77 77
 						, $arg->get_title()
78
-						, $settings['value']
78
+						, $settings[ 'value' ]
79 79
 					)
80 80
 					, 'value'
81 81
 				);
Please login to merge, or discard this patch.
src/classes/hook/condition/string/contains.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 
42 42
 		return false !== strpos(
43 43
 			$args->get_current()->get_the_value()
44
-			, $settings['value']
44
+			, $settings[ 'value' ]
45 45
 		);
46 46
 	}
47 47
 }
Please login to merge, or discard this patch.