Completed
Push — master ( 226003...873ec4 )
by J.D.
03:07
created
src/includes/classes/hook/event/post/publish.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -24,20 +24,20 @@  discard block
 block discarded – undo
24 24
 	 */
25 25
 	public function get_title() {
26 26
 
27
-		$parsed = wordpoints_parse_dynamic_slug( $this->slug );
27
+		$parsed = wordpoints_parse_dynamic_slug($this->slug);
28 28
 
29
-		switch ( $parsed['dynamic'] ) {
29
+		switch ($parsed['dynamic']) {
30 30
 
31 31
 			case 'post':
32
-				return __( 'Publish Post', 'wordpoints' );
32
+				return __('Publish Post', 'wordpoints');
33 33
 
34 34
 			case 'page':
35
-				return __( 'Publish Page', 'wordpoints' );
35
+				return __('Publish Page', 'wordpoints');
36 36
 
37 37
 			default:
38 38
 				return sprintf(
39 39
 					// translators: singular name of the post type
40
-					__( 'Publish %s', 'wordpoints' )
40
+					__('Publish %s', 'wordpoints')
41 41
 					, $this->get_entity_title()
42 42
 				);
43 43
 		}
@@ -48,20 +48,20 @@  discard block
 block discarded – undo
48 48
 	 */
49 49
 	public function get_description() {
50 50
 
51
-		$parsed = wordpoints_parse_dynamic_slug( $this->slug );
51
+		$parsed = wordpoints_parse_dynamic_slug($this->slug);
52 52
 
53
-		switch ( $parsed['dynamic'] ) {
53
+		switch ($parsed['dynamic']) {
54 54
 
55 55
 			case 'post':
56
-				return __( 'When a Post is published.', 'wordpoints' );
56
+				return __('When a Post is published.', 'wordpoints');
57 57
 
58 58
 			case 'page':
59
-				return __( 'When a Page is published.', 'wordpoints' );
59
+				return __('When a Page is published.', 'wordpoints');
60 60
 
61 61
 			default:
62 62
 				return sprintf(
63 63
 					// translators: singular name of the post type
64
-					__( 'When a %s is published.', 'wordpoints' )
64
+					__('When a %s is published.', 'wordpoints')
65 65
 					, $this->get_entity_title()
66 66
 				);
67 67
 		}
Please login to merge, or discard this patch.
src/includes/classes/hook/event/comment/leave.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -24,23 +24,23 @@  discard block
 block discarded – undo
24 24
 	 */
25 25
 	public function get_title() {
26 26
 
27
-		$parsed = wordpoints_parse_dynamic_slug( $this->slug );
27
+		$parsed = wordpoints_parse_dynamic_slug($this->slug);
28 28
 
29
-		switch ( $parsed['dynamic'] ) {
29
+		switch ($parsed['dynamic']) {
30 30
 
31 31
 			case 'post':
32
-				return __( 'Comment on a Post', 'wordpoints' );
32
+				return __('Comment on a Post', 'wordpoints');
33 33
 
34 34
 			case 'page':
35
-				return __( 'Comment on a Page', 'wordpoints' );
35
+				return __('Comment on a Page', 'wordpoints');
36 36
 
37 37
 			case 'attachment':
38
-				return __( 'Comment on a Media Upload', 'wordpoints' );
38
+				return __('Comment on a Media Upload', 'wordpoints');
39 39
 
40 40
 			default:
41 41
 				return sprintf(
42 42
 					// translators: singular name of the post type
43
-					__( 'Comment on a %s', 'wordpoints' )
43
+					__('Comment on a %s', 'wordpoints')
44 44
 					, $this->get_entity_title()
45 45
 				);
46 46
 		}
@@ -51,23 +51,23 @@  discard block
 block discarded – undo
51 51
 	 */
52 52
 	public function get_description() {
53 53
 
54
-		$parsed = wordpoints_parse_dynamic_slug( $this->slug );
54
+		$parsed = wordpoints_parse_dynamic_slug($this->slug);
55 55
 
56
-		switch ( $parsed['dynamic'] ) {
56
+		switch ($parsed['dynamic']) {
57 57
 
58 58
 			case 'post':
59
-				return __( 'When a user leaves a comment on a Post.', 'wordpoints' );
59
+				return __('When a user leaves a comment on a Post.', 'wordpoints');
60 60
 
61 61
 			case 'page':
62
-				return __( 'When a user leaves a comment on a Page.', 'wordpoints' );
62
+				return __('When a user leaves a comment on a Page.', 'wordpoints');
63 63
 
64 64
 			case 'attachment':
65
-				return __( 'When a user leaves a comment on a file uploaded to the Media Library.', 'wordpoints' );
65
+				return __('When a user leaves a comment on a file uploaded to the Media Library.', 'wordpoints');
66 66
 
67 67
 			default:
68 68
 				return sprintf(
69 69
 					// translators: singular name of the post type
70
-					__( 'When a user leaves a comment on a %s.', 'wordpoints' )
70
+					__('When a user leaves a comment on a %s.', 'wordpoints')
71 71
 					, $this->get_entity_title()
72 72
 				);
73 73
 		}
Please login to merge, or discard this patch.
src/includes/classes/entity/relationship/dynamic.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -17,20 +17,20 @@  discard block
 block discarded – undo
17 17
 	/**
18 18
 	 * @since 1.0.0
19 19
 	 */
20
-	public function __construct( $slug ) {
20
+	public function __construct($slug) {
21 21
 
22
-		parent::__construct( $slug );
22
+		parent::__construct($slug);
23 23
 
24
-		$parts = wordpoints_parse_dynamic_slug( $this->slug );
24
+		$parts = wordpoints_parse_dynamic_slug($this->slug);
25 25
 
26
-		if ( $parts['dynamic'] ) {
26
+		if ($parts['dynamic']) {
27 27
 
28
-			$parsed = $this->parse_slug( $this->related_entity_slug );
28
+			$parsed = $this->parse_slug($this->related_entity_slug);
29 29
 
30 30
 			$this->primary_entity_slug = "{$this->primary_entity_slug}\\{$parts['dynamic']}";
31 31
 			$this->related_entity_slug = "{$parsed['slug']}\\{$parts['dynamic']}";
32 32
 
33
-			if ( $parsed['is_array'] ) {
33
+			if ($parsed['is_array']) {
34 34
 				$this->related_entity_slug .= '{}';
35 35
 			}
36 36
 		}
@@ -41,11 +41,11 @@  discard block
 block discarded – undo
41 41
 	 */
42 42
 	public function get_title() {
43 43
 
44
-		$parsed = $this->parse_slug( $this->related_entity_slug );
44
+		$parsed = $this->parse_slug($this->related_entity_slug);
45 45
 
46
-		$entity = wordpoints_entities()->get( $parsed['slug'] );
46
+		$entity = wordpoints_entities()->get($parsed['slug']);
47 47
 
48
-		if ( $entity instanceof WordPoints_Entity ) {
48
+		if ($entity instanceof WordPoints_Entity) {
49 49
 			return $entity->get_title();
50 50
 		} else {
51 51
 			return $this->related_entity_slug;
Please login to merge, or discard this patch.
src/admin/includes/actions.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@
 block discarded – undo
7 7
  * @since 1.0.0
8 8
  */
9 9
 
10
-add_action( 'wordpoints_init_app-apps', 'wordpoints_hooks_register_admin_apps' );
10
+add_action('wordpoints_init_app-apps', 'wordpoints_hooks_register_admin_apps');
11 11
 
12
-add_action( 'admin_menu', 'wordpoints_hooks_api_admin_menu' );
12
+add_action('admin_menu', 'wordpoints_hooks_api_admin_menu');
13 13
 
14
-if ( is_wordpoints_network_active() ) {
15
-	add_action( 'network_admin_menu', 'wordpoints_hooks_api_admin_menu' );
14
+if (is_wordpoints_network_active()) {
15
+	add_action('network_admin_menu', 'wordpoints_hooks_api_admin_menu');
16 16
 }
17 17
 
18
-add_action( 'admin_init', 'wordpoints_hooks_admin_register_scripts' );
19
-add_action( 'admin_init', 'wordpoints_hooks_admin_ajax' );
18
+add_action('admin_init', 'wordpoints_hooks_admin_register_scripts');
19
+add_action('admin_init', 'wordpoints_hooks_admin_ajax');
20 20
 
21
-add_filter( 'script_loader_tag', 'wordpoints_script_templates_filter', 10, 2 );
21
+add_filter('script_loader_tag', 'wordpoints_script_templates_filter', 10, 2);
22 22
 
23 23
 // EOF
Please login to merge, or discard this patch.
src/admin/includes/classes/screen.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 	public function hooks() {
63 63
 
64 64
 		/* Load the JavaScript needed for the settings screen. */
65
-		add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
66
-		add_action( "admin_footer-{$this->id}", array( $this, 'footer_scripts' ) );
65
+		add_action('admin_enqueue_scripts', array($this, 'enqueue_scripts'));
66
+		add_action("admin_footer-{$this->id}", array($this, 'footer_scripts'));
67 67
 	}
68 68
 
69 69
 	/**
@@ -98,12 +98,12 @@  discard block
 block discarded – undo
98 98
 
99 99
 		<div class="wrap">
100 100
 
101
-			<h1><?php echo esc_html( $this->get_title() ); ?></h1>
101
+			<h1><?php echo esc_html($this->get_title()); ?></h1>
102 102
 
103 103
 			<?php settings_errors(); ?>
104 104
 
105
-			<?php if ( ! empty( $this->tabs ) ) : ?>
106
-				<?php wordpoints_admin_show_tabs( $this->tabs, false ); ?>
105
+			<?php if ( ! empty($this->tabs)) : ?>
106
+				<?php wordpoints_admin_show_tabs($this->tabs, false); ?>
107 107
 			<?php endif; ?>
108 108
 
109 109
 			<?php $this->display_content(); ?>
Please login to merge, or discard this patch.
src/admin/includes/classes/screens.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	 * @since 1.0.0
28 28
 	 */
29 29
 	public function __construct() {
30
-		add_action( 'current_screen', array( $this, 'set_current_screen' ) );
30
+		add_action('current_screen', array($this, 'set_current_screen'));
31 31
 	}
32 32
 
33 33
 	/**
@@ -37,23 +37,23 @@  discard block
 block discarded – undo
37 37
 	 *
38 38
 	 * @param WP_Screen $current_screen The WP_Screen object for the current screen.
39 39
 	 */
40
-	public function set_current_screen( $current_screen ) {
40
+	public function set_current_screen($current_screen) {
41 41
 
42 42
 		$screen_id = $current_screen->id;
43 43
 
44
-		if ( is_network_admin() ) {
45
-			$screen_id = substr( $screen_id, 0, -8 /* -network */ );
44
+		if (is_network_admin()) {
45
+			$screen_id = substr($screen_id, 0, -8 /* -network */);
46 46
 		}
47 47
 
48
-		$screen = $this->get( $screen_id );
48
+		$screen = $this->get($screen_id);
49 49
 
50
-		if ( ! ( $screen instanceof WordPoints_Admin_Screen ) ) {
50
+		if ( ! ($screen instanceof WordPoints_Admin_Screen)) {
51 51
 			return;
52 52
 		}
53 53
 
54 54
 		$this->current_screen = $screen;
55 55
 
56
-		add_action( "load-{$screen_id}", array( $this->current_screen, 'load' ) );
56
+		add_action("load-{$screen_id}", array($this->current_screen, 'load'));
57 57
 	}
58 58
 
59 59
 	/**
Please login to merge, or discard this patch.
src/includes/classes/entity/context/network.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 	 */
22 22
 	public function get_current_id() {
23 23
 
24
-		if ( ! is_multisite() ) {
24
+		if ( ! is_multisite()) {
25 25
 			return 1;
26 26
 		}
27 27
 
Please login to merge, or discard this patch.
src/includes/classes/entity/context.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@
 block discarded – undo
26 26
 	/**
27 27
 	 * @since 1.0.0
28 28
 	 */
29
-	public function __construct( $slug ) {
29
+	public function __construct($slug) {
30 30
 
31 31
 		$this->slug = $slug;
32 32
 	}
Please login to merge, or discard this patch.
src/includes/classes/hook/event/args.php 2 patches
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -63,22 +63,22 @@  discard block
 block discarded – undo
63 63
 	 *
64 64
 	 * @param WordPoints_Hook_Arg[] $args The hook args.
65 65
 	 */
66
-	public function __construct( array $args ) {
66
+	public function __construct(array $args) {
67 67
 
68 68
 		parent::__construct();
69 69
 
70
-		foreach ( $args as $arg ) {
70
+		foreach ($args as $arg) {
71 71
 
72 72
 			$entity = $arg->get_entity();
73 73
 			$slug = $arg->get_slug();
74 74
 
75
-			if ( ! $entity instanceof WordPoints_Entity ) {
75
+			if ( ! $entity instanceof WordPoints_Entity) {
76 76
 				continue;
77 77
 			}
78 78
 
79
-			$this->entities[ $slug ] = $entity;
79
+			$this->entities[$slug] = $entity;
80 80
 
81
-			if ( ! $arg->is_stateful() ) {
81
+			if ( ! $arg->is_stateful()) {
82 82
 				// If any of the args aren't stateful the event isn't repeatable.
83 83
 				$this->is_repeatable = false;
84 84
 				$this->primary_arg_slug = $slug;
@@ -115,11 +115,11 @@  discard block
 block discarded – undo
115 115
 	 */
116 116
 	public function get_primary_arg() {
117 117
 
118
-		if ( ! $this->primary_arg_slug ) {
118
+		if ( ! $this->primary_arg_slug) {
119 119
 			return false;
120 120
 		}
121 121
 
122
-		return $this->entities[ $this->primary_arg_slug ];
122
+		return $this->entities[$this->primary_arg_slug];
123 123
 	}
124 124
 
125 125
 	/**
@@ -133,8 +133,8 @@  discard block
 block discarded – undo
133 133
 
134 134
 		$stateful = $this->entities;
135 135
 
136
-		if ( $this->primary_arg_slug ) {
137
-			unset( $stateful[ $this->primary_arg_slug ] );
136
+		if ($this->primary_arg_slug) {
137
+			unset($stateful[$this->primary_arg_slug]);
138 138
 		}
139 139
 
140 140
 		return $stateful;
@@ -147,54 +147,54 @@  discard block
 block discarded – undo
147 147
 	 *
148 148
 	 * @param WordPoints_Hook_Reaction_Validator $validator The validator.
149 149
 	 */
150
-	public function set_validator( WordPoints_Hook_Reaction_Validator $validator ) {
150
+	public function set_validator(WordPoints_Hook_Reaction_Validator $validator) {
151 151
 		$this->validator = $validator;
152 152
 	}
153 153
 
154 154
 	/**
155 155
 	 * @since 1.0.0
156 156
 	 */
157
-	public function descend( $child_slug ) {
157
+	public function descend($child_slug) {
158 158
 
159
-		$result = parent::descend( $child_slug );
159
+		$result = parent::descend($child_slug);
160 160
 
161 161
 		// Just in case no validator has been set.
162
-		if ( ! $this->validator ) {
162
+		if ( ! $this->validator) {
163 163
 			return $result;
164 164
 		}
165 165
 
166
-		if ( ! $result ) {
166
+		if ( ! $result) {
167 167
 
168
-			if ( ! isset( $this->current ) ) {
168
+			if ( ! isset($this->current)) {
169 169
 
170 170
 				$this->validator->add_error(
171 171
 					sprintf(
172
-						__( 'The %s arg is not registered for this event.', 'wordpoints' ) // TODO message
172
+						__('The %s arg is not registered for this event.', 'wordpoints') // TODO message
173 173
 						, $child_slug
174 174
 					)
175 175
 				);
176 176
 
177
-			} elseif ( ! ( $this->current instanceof WordPoints_Entity_ParentI ) ) {
177
+			} elseif ( ! ($this->current instanceof WordPoints_Entity_ParentI)) {
178 178
 
179 179
 				$this->validator->add_error(
180
-					__( 'Cannot get descendant of %s: not a parent.', 'wordpoints' ) // TODO message
180
+					__('Cannot get descendant of %s: not a parent.', 'wordpoints') // TODO message
181 181
 				);
182 182
 
183 183
 			} else {
184 184
 
185
-				$child_arg = $this->current->get_child( $child_slug );
185
+				$child_arg = $this->current->get_child($child_slug);
186 186
 
187
-				if ( ! $child_arg ) {
187
+				if ( ! $child_arg) {
188 188
 					$this->validator->add_error(
189
-						__( '%s does not have a child "%s".', 'wordpoints' ) // TODO message
189
+						__('%s does not have a child "%s".', 'wordpoints') // TODO message
190 190
 						, $this->push_on_descend ? $child_slug : null
191 191
 					);
192 192
 				}
193 193
 			}
194 194
 
195
-		} elseif ( $this->push_on_descend ) {
195
+		} elseif ($this->push_on_descend) {
196 196
 
197
-			$this->validator->push_field( $child_slug );
197
+			$this->validator->push_field($child_slug);
198 198
 		}
199 199
 
200 200
 		return $result;
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 
208 208
 		$ascended = parent::ascend();
209 209
 
210
-		if ( $ascended && $this->validator ) {
210
+		if ($ascended && $this->validator) {
211 211
 			$this->validator->pop_field();
212 212
 		}
213 213
 
@@ -217,10 +217,10 @@  discard block
 block discarded – undo
217 217
 	/**
218 218
 	 * @since 1.0.0
219 219
 	 */
220
-	public function get_from_hierarchy( array $hierarchy ) {
220
+	public function get_from_hierarchy(array $hierarchy) {
221 221
 
222 222
 		$this->push_on_descend = false;
223
-		$entityish = parent::get_from_hierarchy( $hierarchy );
223
+		$entityish = parent::get_from_hierarchy($hierarchy);
224 224
 		$this->push_on_descend = true;
225 225
 
226 226
 		return $entityish;
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@
 block discarded – undo
144 144
 	 *
145 145
 	 * @since 1.0.0
146 146
 	 *
147
-	 * @return WordPoints_Hook_Reaction_Validator|null The validator or null if none.
147
+	 * @return WordPoints_Hook_Reaction_Validator The validator or null if none.
148 148
 	 */
149 149
 	public function get_validator() {
150 150
 		return $this->validator;
Please login to merge, or discard this patch.