@@ -20,21 +20,21 @@ |
||
20 | 20 | * @since 2.1.0 |
21 | 21 | */ |
22 | 22 | public function get_title() { |
23 | - return __( 'Register', 'wordpoints' ); |
|
23 | + return __('Register', 'wordpoints'); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
27 | 27 | * @since 2.1.0 |
28 | 28 | */ |
29 | 29 | public function get_description() { |
30 | - return __( 'Registering.', 'wordpoints' ); |
|
30 | + return __('Registering.', 'wordpoints'); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | /** |
34 | 34 | * @since 2.1.0 |
35 | 35 | */ |
36 | 36 | public function get_reversal_text() { |
37 | - return __( 'User removed.', 'wordpoints' ); |
|
37 | + return __('User removed.', 'wordpoints'); |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 |
@@ -30,7 +30,7 @@ |
||
30 | 30 | * @since 2.1.0 |
31 | 31 | */ |
32 | 32 | public function get_title() { |
33 | - return __( 'Visitor', 'wordpoints' ); |
|
33 | + return __('Visitor', 'wordpoints'); |
|
34 | 34 | } |
35 | 35 | } |
36 | 36 |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | * @param int $id The ID of a hook reaction. |
41 | 41 | * @param WordPoints_Hook_Reaction_StoreI $store The storage object. |
42 | 42 | */ |
43 | - public function __construct( $id, WordPoints_Hook_Reaction_StoreI $store ) { |
|
43 | + public function __construct($id, WordPoints_Hook_Reaction_StoreI $store) { |
|
44 | 44 | |
45 | - $this->ID = wordpoints_int( $id ); |
|
45 | + $this->ID = wordpoints_int($id); |
|
46 | 46 | $this->store = $store; |
47 | 47 | } |
48 | 48 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * @since 2.1.0 |
71 | 71 | */ |
72 | 72 | public function get_reactor_slug() { |
73 | - return $this->get_meta( 'reactor' ); |
|
73 | + return $this->get_meta('reactor'); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -75,9 +75,9 @@ discard block |
||
75 | 75 | $this->slug = $slug; |
76 | 76 | $this->action = $action; |
77 | 77 | |
78 | - $parts = explode( ':', $slug, 2 ); |
|
78 | + $parts = explode(':', $slug, 2); |
|
79 | 79 | |
80 | - if ( isset( $parts[1] ) ) { |
|
80 | + if (isset($parts[1])) { |
|
81 | 81 | $this->entity_slug = $parts[1]; |
82 | 82 | } else { |
83 | 83 | $this->entity_slug = $slug; |
@@ -107,11 +107,11 @@ discard block |
||
107 | 107 | $this->get_entity_slug() |
108 | 108 | ); |
109 | 109 | |
110 | - if ( $entity instanceof WordPoints_Entity ) { |
|
110 | + if ($entity instanceof WordPoints_Entity) { |
|
111 | 111 | $value = $this->get_value(); |
112 | 112 | |
113 | - if ( $value ) { |
|
114 | - $entity->set_the_value( $value ); |
|
113 | + if ($value) { |
|
114 | + $entity->set_the_value($value); |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | |
@@ -123,8 +123,8 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public function get_value() { |
125 | 125 | |
126 | - if ( $this->action instanceof WordPoints_Hook_ActionI ) { |
|
127 | - return $this->action->get_arg_value( $this->slug ); |
|
126 | + if ($this->action instanceof WordPoints_Hook_ActionI) { |
|
127 | + return $this->action->get_arg_value($this->slug); |
|
128 | 128 | } else { |
129 | 129 | return null; |
130 | 130 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | |
138 | 138 | $entity = $this->get_entity(); |
139 | 139 | |
140 | - if ( ! $entity ) { |
|
140 | + if ( ! $entity) { |
|
141 | 141 | return $this->slug; |
142 | 142 | } |
143 | 143 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | * |
51 | 51 | * @return mixed The arg value. |
52 | 52 | */ |
53 | - public function get_arg_value( $arg_slug ); |
|
53 | + public function get_arg_value($arg_slug); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | // EOF |
@@ -83,16 +83,16 @@ discard block |
||
83 | 83 | * @param array $action_args The args the action was fired with. |
84 | 84 | * @param array $args Other args. |
85 | 85 | */ |
86 | - public function __construct( $slug, array $action_args, array $args = array() ) { |
|
86 | + public function __construct($slug, array $action_args, array $args = array()) { |
|
87 | 87 | |
88 | 88 | $this->slug = $slug; |
89 | 89 | $this->args = $action_args; |
90 | 90 | |
91 | - if ( isset( $args['requirements'] ) ) { |
|
91 | + if (isset($args['requirements'])) { |
|
92 | 92 | $this->requirements = $args['requirements']; |
93 | 93 | } |
94 | 94 | |
95 | - if ( isset( $args['arg_index'] ) ) { |
|
95 | + if (isset($args['arg_index'])) { |
|
96 | 96 | $this->arg_index = $args['arg_index']; |
97 | 97 | } |
98 | 98 | } |
@@ -109,25 +109,25 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function should_fire() { |
111 | 111 | |
112 | - foreach ( $this->requirements as $arg => $value ) { |
|
112 | + foreach ($this->requirements as $arg => $value) { |
|
113 | 113 | |
114 | 114 | $comparator = '='; |
115 | 115 | |
116 | - if ( is_array( $value ) && isset( $value['comparator'], $value['value'] ) ) { |
|
116 | + if (is_array($value) && isset($value['comparator'], $value['value'])) { |
|
117 | 117 | $comparator = $value['comparator']; |
118 | 118 | $value = $value['value']; |
119 | 119 | } |
120 | 120 | |
121 | - switch ( $comparator ) { |
|
121 | + switch ($comparator) { |
|
122 | 122 | |
123 | 123 | case '=': |
124 | - if ( ! isset( $this->args[ $arg ] ) || $this->args[ $arg ] !== $value ) { |
|
124 | + if ( ! isset($this->args[$arg]) || $this->args[$arg] !== $value) { |
|
125 | 125 | return false; |
126 | 126 | } |
127 | 127 | break; |
128 | 128 | |
129 | 129 | case '!=': |
130 | - if ( isset( $this->args[ $arg ] ) && $this->args[ $arg ] === $value ) { |
|
130 | + if (isset($this->args[$arg]) && $this->args[$arg] === $value) { |
|
131 | 131 | return false; |
132 | 132 | } |
133 | 133 | break; |
@@ -140,19 +140,19 @@ discard block |
||
140 | 140 | /** |
141 | 141 | * @since 2.1.0 |
142 | 142 | */ |
143 | - public function get_arg_value( $arg_slug ) { |
|
143 | + public function get_arg_value($arg_slug) { |
|
144 | 144 | |
145 | - if ( ! isset( $this->arg_index[ $arg_slug ] ) ) { |
|
145 | + if ( ! isset($this->arg_index[$arg_slug])) { |
|
146 | 146 | return null; |
147 | 147 | } |
148 | 148 | |
149 | - $index = $this->arg_index[ $arg_slug ]; |
|
149 | + $index = $this->arg_index[$arg_slug]; |
|
150 | 150 | |
151 | - if ( ! isset( $this->args[ $index ] ) ) { |
|
151 | + if ( ! isset($this->args[$index])) { |
|
152 | 152 | return null; |
153 | 153 | } |
154 | 154 | |
155 | - return $this->args[ $index ]; |
|
155 | + return $this->args[$index]; |
|
156 | 156 | } |
157 | 157 | } |
158 | 158 |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @var string[] |
23 | 23 | */ |
24 | - protected $post_hierarchy = array( 'post\\post' ); |
|
24 | + protected $post_hierarchy = array('post\\post'); |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * @since 2.1.0 |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | $post = $this->get_post_entity(); |
32 | 32 | |
33 | - if ( ! $post ) { |
|
33 | + if ( ! $post) { |
|
34 | 34 | return false; |
35 | 35 | } |
36 | 36 | |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | */ |
49 | 49 | protected function get_post_entity() { |
50 | 50 | |
51 | - $parts = wordpoints_parse_dynamic_slug( $this->slug ); |
|
51 | + $parts = wordpoints_parse_dynamic_slug($this->slug); |
|
52 | 52 | |
53 | - if ( ! $parts['dynamic'] ) { |
|
53 | + if ( ! $parts['dynamic']) { |
|
54 | 54 | return false; |
55 | 55 | } |
56 | 56 | |
@@ -60,30 +60,30 @@ discard block |
||
60 | 60 | , $this->post_hierarchy |
61 | 61 | ); |
62 | 62 | |
63 | - $entity = wordpoints_entities()->get( $this->post_hierarchy[0] ); |
|
63 | + $entity = wordpoints_entities()->get($this->post_hierarchy[0]); |
|
64 | 64 | |
65 | - if ( ! $entity instanceof WordPoints_Entity ) { |
|
65 | + if ( ! $entity instanceof WordPoints_Entity) { |
|
66 | 66 | return false; |
67 | 67 | } |
68 | 68 | |
69 | - $entity->set_the_value( $this->get_arg_value( $this->post_hierarchy[0] ) ); |
|
69 | + $entity->set_the_value($this->get_arg_value($this->post_hierarchy[0])); |
|
70 | 70 | |
71 | - if ( 1 === count( $this->post_hierarchy ) ) { |
|
71 | + if (1 === count($this->post_hierarchy)) { |
|
72 | 72 | |
73 | 73 | $post_entity = $entity; |
74 | 74 | |
75 | 75 | } else { |
76 | 76 | |
77 | - $args = new WordPoints_Entity_Hierarchy( $entity ); |
|
77 | + $args = new WordPoints_Entity_Hierarchy($entity); |
|
78 | 78 | |
79 | - $post_entity = $args->get_from_hierarchy( $this->post_hierarchy ); |
|
79 | + $post_entity = $args->get_from_hierarchy($this->post_hierarchy); |
|
80 | 80 | |
81 | - if ( ! $post_entity instanceof WordPoints_Entity ) { |
|
81 | + if ( ! $post_entity instanceof WordPoints_Entity) { |
|
82 | 82 | return false; |
83 | 83 | } |
84 | 84 | } |
85 | 85 | |
86 | - if ( $parts['dynamic'] !== $post_entity->get_the_attr_value( 'post_type' ) ) { |
|
86 | + if ($parts['dynamic'] !== $post_entity->get_the_attr_value('post_type')) { |
|
87 | 87 | return false; |
88 | 88 | } |
89 | 89 |
@@ -21,11 +21,11 @@ |
||
21 | 21 | |
22 | 22 | $post = $this->get_post_entity(); |
23 | 23 | |
24 | - if ( ! $post ) { |
|
24 | + if ( ! $post) { |
|
25 | 25 | return false; |
26 | 26 | } |
27 | 27 | |
28 | - if ( 'publish' !== get_post_status( $post->get_the_id() ) ) { |
|
28 | + if ('publish' !== get_post_status($post->get_the_id())) { |
|
29 | 29 | return false; |
30 | 30 | } |
31 | 31 |
@@ -18,7 +18,7 @@ |
||
18 | 18 | /** |
19 | 19 | * @since 2.1.0 |
20 | 20 | */ |
21 | - protected $post_hierarchy = array( 'comment\\post', 'post\\post', 'post\\post' ); |
|
21 | + protected $post_hierarchy = array('comment\\post', 'post\\post', 'post\\post'); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | // EOF |