Completed
Push — master ( 144c08...e73d65 )
by J.D.
02:53
created
src/includes/classes/entityish.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 	 *
40 40
 	 * @param string $slug The slug of the entity/entity-child.
41 41
 	 */
42
-	public function __construct( $slug ) {
42
+	public function __construct($slug) {
43 43
 		$this->slug = $slug;
44 44
 	}
45 45
 
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 	/**
61 61
 	 * @since 1.0.0
62 62
 	 */
63
-	public function set_the_value( $value ) {
63
+	public function set_the_value($value) {
64 64
 
65 65
 		$this->the_value = $value;
66 66
 
Please login to merge, or discard this patch.
src/includes/classes/entityishi.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@
 block discarded – undo
60 60
 	 *
61 61
 	 * @return bool Whether the value was set successfully.
62 62
 	 */
63
-	public function set_the_value( $value );
63
+	public function set_the_value($value);
64 64
 }
65 65
 
66 66
 // EOF
Please login to merge, or discard this patch.
src/includes/classes/hook/action.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -66,16 +66,16 @@  discard block
 block discarded – undo
66 66
 	/**
67 67
 	 * @since 1.0.0
68 68
 	 */
69
-	public function __construct( $slug, array $action_args, array $args = array() ) {
69
+	public function __construct($slug, array $action_args, array $args = array()) {
70 70
 
71 71
 		$this->slug = $slug;
72 72
 		$this->args = $action_args;
73 73
 
74
-		if ( isset( $args['requirements'] ) ) {
74
+		if (isset($args['requirements'])) {
75 75
 			$this->requirements = $args['requirements'];
76 76
 		}
77 77
 
78
-		if ( isset( $args['arg_index'] ) ) {
78
+		if (isset($args['arg_index'])) {
79 79
 			$this->arg_index = $args['arg_index'];
80 80
 		}
81 81
 	}
@@ -92,8 +92,8 @@  discard block
 block discarded – undo
92 92
 	 */
93 93
 	public function should_fire() {
94 94
 
95
-		foreach ( $this->requirements as $arg => $value ) {
96
-			if ( ! isset( $this->args[ $arg ] ) || $this->args[ $arg ] !== $value ) {
95
+		foreach ($this->requirements as $arg => $value) {
96
+			if ( ! isset($this->args[$arg]) || $this->args[$arg] !== $value) {
97 97
 				return false;
98 98
 			}
99 99
 		}
@@ -104,19 +104,19 @@  discard block
 block discarded – undo
104 104
 	/**
105 105
 	 * @since 1.0.0
106 106
 	 */
107
-	public function get_arg_value( $arg_slug ) {
107
+	public function get_arg_value($arg_slug) {
108 108
 
109
-		if ( ! isset( $this->arg_index[ $arg_slug ] ) ) {
109
+		if ( ! isset($this->arg_index[$arg_slug])) {
110 110
 			return null;
111 111
 		}
112 112
 
113
-		$index = $this->arg_index[ $arg_slug ];
113
+		$index = $this->arg_index[$arg_slug];
114 114
 
115
-		if ( ! isset( $this->args[ $index ] ) ) {
115
+		if ( ! isset($this->args[$index])) {
116 116
 			return null;
117 117
 		}
118 118
 
119
-		return $this->args[ $index ];
119
+		return $this->args[$index];
120 120
 	}
121 121
 }
122 122
 
Please login to merge, or discard this patch.
src/includes/classes/hook/action/post/publish.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,16 +19,16 @@
 block discarded – undo
19 19
 	 */
20 20
 	public function should_fire() {
21 21
 
22
-		$post = $this->get_arg_value( 'post' );
22
+		$post = $this->get_arg_value('post');
23 23
 
24
-		if ( ! isset( $post->post_type ) ) {
24
+		if ( ! isset($post->post_type)) {
25 25
 			return false;
26 26
 		}
27 27
 
28
-		$post_type = get_post_type_object( $post->post_type );
28
+		$post_type = get_post_type_object($post->post_type);
29 29
 
30 30
 		// Don't fire for non-public post types (revisions, etc.).
31
-		if ( empty( $post_type->public ) ) {
31
+		if (empty($post_type->public)) {
32 32
 			return false;
33 33
 		}
34 34
 
Please login to merge, or discard this patch.
src/includes/classes/hook/actioni.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 	 * @param array  $action_args The args the action was fired with.
27 27
 	 * @param array  $args        Other args.
28 28
 	 */
29
-	public function __construct( $slug, array $action_args, array $args = array() );
29
+	public function __construct($slug, array $action_args, array $args = array());
30 30
 
31 31
 	/**
32 32
 	 * Get the slug of this action.
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 	 *
58 58
 	 * @return mixed The arg value.
59 59
 	 */
60
-	public function get_arg_value( $arg_slug );
60
+	public function get_arg_value($arg_slug);
61 61
 }
62 62
 
63 63
 // EOF
Please login to merge, or discard this patch.
src/includes/classes/hook/actions.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -40,23 +40,23 @@  discard block
 block discarded – undo
40 40
 	 *
41 41
 	 * @return object|false The action object, or false if not found.
42 42
 	 */
43
-	public function get( $slug, array $action_args = array(), array $args = array() ) {
43
+	public function get($slug, array $action_args = array(), array $args = array()) {
44 44
 
45
-		if ( ! isset( $this->classes[ $slug ] ) ) {
45
+		if ( ! isset($this->classes[$slug])) {
46 46
 			return false;
47 47
 		}
48 48
 
49
-		return new $this->classes[ $slug ]( $slug, $action_args, $args );
49
+		return new $this->classes[$slug]($slug, $action_args, $args);
50 50
 	}
51 51
 
52 52
 	/**
53 53
 	 * @since 1.0.0
54 54
 	 */
55
-	public function register( $slug, $class, array $args = array() ) {
55
+	public function register($slug, $class, array $args = array()) {
56 56
 
57
-		parent::register( $slug, $class, $args );
57
+		parent::register($slug, $class, $args);
58 58
 
59
-		$this->router->add_action( $slug, $args );
59
+		$this->router->add_action($slug, $args);
60 60
 
61 61
 		return true;
62 62
 	}
@@ -64,11 +64,11 @@  discard block
 block discarded – undo
64 64
 	/**
65 65
 	 * @since 1.0.0
66 66
 	 */
67
-	public function deregister( $slug ) {
67
+	public function deregister($slug) {
68 68
 
69
-		parent::deregister( $slug );
69
+		parent::deregister($slug);
70 70
 
71
-		$this->router->remove_action( $slug );
71
+		$this->router->remove_action($slug);
72 72
 	}
73 73
 }
74 74
 
Please login to merge, or discard this patch.
src/includes/classes/hook/arg/current/post.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 * @since 1.0.0
19 19
 	 */
20 20
 	public function get_title() {
21
-		return __( 'Current Post', 'wordpoints' ); // TODO better title?
21
+		return __('Current Post', 'wordpoints'); // TODO better title?
22 22
 	}
23 23
 
24 24
 	/**
@@ -26,13 +26,13 @@  discard block
 block discarded – undo
26 26
 	 */
27 27
 	public function get_value() {
28 28
 
29
-		if ( ! is_main_query() ) {
29
+		if ( ! is_main_query()) {
30 30
 			return false;
31 31
 		}
32 32
 
33 33
 		$object = get_queried_object();
34 34
 
35
-		if ( $object instanceof WP_Post ) {
35
+		if ($object instanceof WP_Post) {
36 36
 			return $object;
37 37
 		} else {
38 38
 			return false;
Please login to merge, or discard this patch.
src/includes/classes/hook/arg/current/user.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 	 * @since 1.0.0
26 26
 	 */
27 27
 	public function get_title() {
28
-		return __( 'Visitor', 'wordpoints' );
28
+		return __('Visitor', 'wordpoints');
29 29
 	}
30 30
 }
31 31
 
Please login to merge, or discard this patch.
src/includes/classes/hook/condition.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -23,33 +23,33 @@  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
 
30 30
 			$validator->add_error(
31 31
 				sprintf(
32
-					__( '%s is required.', 'wordpoints' )
32
+					__('%s is required.', 'wordpoints')
33 33
 					, $settings_fields['value']['label']
34 34
 				)
35 35
 				, 'value'
36 36
 			);
37 37
 
38
-		} elseif ( $arg instanceof WordPoints_Entity_Attr ) {
38
+		} elseif ($arg instanceof WordPoints_Entity_Attr) {
39 39
 
40 40
 			$data_types = wordpoints_apps()->data_types;
41 41
 
42
-			$data_type = $data_types->get( $arg->get_data_type() );
42
+			$data_type = $data_types->get($arg->get_data_type());
43 43
 
44 44
 			// If this data type isn't recognized, that's probably OK. Validation is
45 45
 			// just to help the user know that they've made a mistake anyway.
46
-			if ( ! ( $data_type instanceof WordPoints_Data_TypeI ) ) {
46
+			if ( ! ($data_type instanceof WordPoints_Data_TypeI)) {
47 47
 				return $settings;
48 48
 			}
49 49
 
50
-			$validated_value = $data_type->validate_value( $settings['value'] );
50
+			$validated_value = $data_type->validate_value($settings['value']);
51 51
 
52
-			if ( is_wp_error( $validated_value ) ) {
52
+			if (is_wp_error($validated_value)) {
53 53
 
54 54
 				$settings_fields = $this->get_settings_fields();
55 55
 
@@ -66,13 +66,13 @@  discard block
 block discarded – undo
66 66
 
67 67
 			$settings['value'] = $validated_value;
68 68
 
69
-		} elseif ( $arg instanceof WordPoints_Entity ) {
69
+		} elseif ($arg instanceof WordPoints_Entity) {
70 70
 
71
-			if ( ! $arg->exists( $settings['value'] ) ) {
71
+			if ( ! $arg->exists($settings['value'])) {
72 72
 				$validator->add_error(
73 73
 					sprintf(
74 74
 						// translators: 1. item type, 2. item ID/slug.
75
-						__( '%1$s “%2$s” not found.', 'wordpoints' )
75
+						__('%1$s “%2$s” not found.', 'wordpoints')
76 76
 						, $arg->get_title()
77 77
 						, $settings['value']
78 78
 					)
Please login to merge, or discard this patch.