@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * @since 1.0.0 |
19 | 19 | */ |
20 | 20 | public function get_title() { |
21 | - return __( 'Equals', 'wordpoints' ); |
|
21 | + return __('Equals', 'wordpoints'); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | return array( |
30 | 30 | 'value' => array( |
31 | 31 | 'type' => 'text', |
32 | - 'label' => __( 'Equals', 'wordpoints' ), // TODO |
|
32 | + 'label' => __('Equals', 'wordpoints'), // TODO |
|
33 | 33 | ), |
34 | 34 | ); |
35 | 35 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | /** |
38 | 38 | * @since 1.0.0 |
39 | 39 | */ |
40 | - public function is_met( array $settings, WordPoints_Hook_Event_Args $args ) { |
|
40 | + public function is_met(array $settings, WordPoints_Hook_Event_Args $args) { |
|
41 | 41 | |
42 | 42 | return $settings['value'] === $args->get_current()->get_the_value(); |
43 | 43 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * @since 1.0.0 |
19 | 19 | */ |
20 | 20 | public function get_title() { |
21 | - return __( 'Contains', 'wordpoints' ); |
|
21 | + return __('Contains', 'wordpoints'); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | return array( |
29 | 29 | 'value' => array( |
30 | 30 | 'type' => 'text', |
31 | - 'label' => __( 'Contains', 'wordpoints' ), // TODO |
|
31 | + 'label' => __('Contains', 'wordpoints'), // TODO |
|
32 | 32 | 'required' => true, |
33 | 33 | ), |
34 | 34 | ); |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | /** |
38 | 38 | * @since 1.0.0 |
39 | 39 | */ |
40 | - public function is_met( array $settings, WordPoints_Hook_Event_Args $args ) { |
|
40 | + public function is_met(array $settings, WordPoints_Hook_Event_Args $args) { |
|
41 | 41 | |
42 | 42 | return false !== strpos( |
43 | 43 | $args->get_current()->get_the_value() |
@@ -64,7 +64,7 @@ |
||
64 | 64 | * |
65 | 65 | * @return bool Whether this condition is met. |
66 | 66 | */ |
67 | - public function is_met( array $settings, WordPoints_Hook_Event_Args $args ); |
|
67 | + public function is_met(array $settings, WordPoints_Hook_Event_Args $args); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | // EOF |
@@ -26,7 +26,7 @@ |
||
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 | } |
@@ -45,16 +45,16 @@ discard block |
||
45 | 45 | * |
46 | 46 | * @param WordPoints_Hook_Arg[] $args The hook args. |
47 | 47 | */ |
48 | - public function __construct( array $args ) { |
|
48 | + public function __construct(array $args) { |
|
49 | 49 | |
50 | 50 | parent::__construct(); |
51 | 51 | |
52 | - foreach ( $args as $arg ) { |
|
52 | + foreach ($args as $arg) { |
|
53 | 53 | |
54 | 54 | $entity = $arg->get_entity(); |
55 | 55 | |
56 | - if ( $entity instanceof WordPoints_Entity ) { |
|
57 | - $this->entities[ $arg->get_slug() ] = $entity; |
|
56 | + if ($entity instanceof WordPoints_Entity) { |
|
57 | + $this->entities[$arg->get_slug()] = $entity; |
|
58 | 58 | } |
59 | 59 | } |
60 | 60 | } |
@@ -66,54 +66,54 @@ discard block |
||
66 | 66 | * |
67 | 67 | * @param WordPoints_Hook_Reaction_Validator $validator The validator. |
68 | 68 | */ |
69 | - public function set_validator( WordPoints_Hook_Reaction_Validator $validator ) { |
|
69 | + public function set_validator(WordPoints_Hook_Reaction_Validator $validator) { |
|
70 | 70 | $this->validator = $validator; |
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
74 | 74 | * @since 1.0.0 |
75 | 75 | */ |
76 | - public function descend( $child_slug ) { |
|
76 | + public function descend($child_slug) { |
|
77 | 77 | |
78 | - $result = parent::descend( $child_slug ); |
|
78 | + $result = parent::descend($child_slug); |
|
79 | 79 | |
80 | 80 | // Just in case no validator has been set. |
81 | - if ( ! $this->validator ) { |
|
81 | + if ( ! $this->validator) { |
|
82 | 82 | return $result; |
83 | 83 | } |
84 | 84 | |
85 | - if ( ! $result ) { |
|
85 | + if ( ! $result) { |
|
86 | 86 | |
87 | - if ( ! isset( $this->current ) ) { |
|
87 | + if ( ! isset($this->current)) { |
|
88 | 88 | |
89 | 89 | $this->validator->add_error( |
90 | 90 | sprintf( |
91 | - __( 'The %s arg is not registered for this event.', 'wordpoints' ) // TODO message |
|
91 | + __('The %s arg is not registered for this event.', 'wordpoints') // TODO message |
|
92 | 92 | , $child_slug |
93 | 93 | ) |
94 | 94 | ); |
95 | 95 | |
96 | - } elseif ( ! ( $this->current instanceof WordPoints_Entity_ParentI ) ) { |
|
96 | + } elseif ( ! ($this->current instanceof WordPoints_Entity_ParentI)) { |
|
97 | 97 | |
98 | 98 | $this->validator->add_error( |
99 | - __( 'Cannot get descendant of %s: not a parent.', 'wordpoints' ) // TODO message |
|
99 | + __('Cannot get descendant of %s: not a parent.', 'wordpoints') // TODO message |
|
100 | 100 | ); |
101 | 101 | |
102 | 102 | } else { |
103 | 103 | |
104 | - $child_arg = $this->current->get_child( $child_slug ); |
|
104 | + $child_arg = $this->current->get_child($child_slug); |
|
105 | 105 | |
106 | - if ( ! $child_arg ) { |
|
106 | + if ( ! $child_arg) { |
|
107 | 107 | $this->validator->add_error( |
108 | - __( '%s does not have a child "%s".', 'wordpoints' ) // TODO message |
|
108 | + __('%s does not have a child "%s".', 'wordpoints') // TODO message |
|
109 | 109 | , $this->push_on_descend ? $child_slug : null |
110 | 110 | ); |
111 | 111 | } |
112 | 112 | } |
113 | 113 | |
114 | - } elseif ( $this->push_on_descend ) { |
|
114 | + } elseif ($this->push_on_descend) { |
|
115 | 115 | |
116 | - $this->validator->push_field( $child_slug ); |
|
116 | + $this->validator->push_field($child_slug); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | return $result; |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | $ascended = parent::ascend(); |
128 | 128 | |
129 | - if ( $ascended && $this->validator ) { |
|
129 | + if ($ascended && $this->validator) { |
|
130 | 130 | $this->validator->pop_field(); |
131 | 131 | } |
132 | 132 | |
@@ -136,10 +136,10 @@ discard block |
||
136 | 136 | /** |
137 | 137 | * @since 1.0.0 |
138 | 138 | */ |
139 | - public function get_from_hierarchy( array $hierarchy ) { |
|
139 | + public function get_from_hierarchy(array $hierarchy) { |
|
140 | 140 | |
141 | 141 | $this->push_on_descend = false; |
142 | - $entityish = parent::get_from_hierarchy( $hierarchy ); |
|
142 | + $entityish = parent::get_from_hierarchy($hierarchy); |
|
143 | 143 | $this->push_on_descend = true; |
144 | 144 | |
145 | 145 | return $entityish; |
@@ -18,14 +18,14 @@ |
||
18 | 18 | * @since 1.0.0 |
19 | 19 | */ |
20 | 20 | public function get_title() { |
21 | - return __( 'Comment', 'wordpoints' ); |
|
21 | + return __('Comment', 'wordpoints'); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
25 | 25 | * @since 1.0.0 |
26 | 26 | */ |
27 | 27 | public function get_description() { |
28 | - return __( 'When a user leaves a reply to a Post or other type of content.', 'wordpoints' ); |
|
28 | + return __('When a user leaves a reply to a Post or other type of content.', 'wordpoints'); |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 |
@@ -18,14 +18,14 @@ |
||
18 | 18 | * @since 1.0.0 |
19 | 19 | */ |
20 | 20 | public function get_title() { |
21 | - return __( 'Post Publish', 'wordpoints' ); |
|
21 | + return __('Post Publish', 'wordpoints'); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
25 | 25 | * @since 1.0.0 |
26 | 26 | */ |
27 | 27 | public function get_description() { |
28 | - return __( 'When a Post, Page, or other type of content is published.', 'wordpoints' ); |
|
28 | + return __('When a Post, Page, or other type of content is published.', 'wordpoints'); |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 |
@@ -18,14 +18,14 @@ |
||
18 | 18 | * @since 1.0.0 |
19 | 19 | */ |
20 | 20 | public function get_title() { |
21 | - return __( 'Register', 'wordpoints' ); |
|
21 | + return __('Register', 'wordpoints'); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
25 | 25 | * @since 1.0.0 |
26 | 26 | */ |
27 | 27 | public function get_description() { |
28 | - return __( 'Registering.', 'wordpoints' ); |
|
28 | + return __('Registering.', 'wordpoints'); |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 |
@@ -18,14 +18,14 @@ |
||
18 | 18 | * @since 1.0.0 |
19 | 19 | */ |
20 | 20 | public function get_title() { |
21 | - return __( 'Visit', 'wordpoints' ); |
|
21 | + return __('Visit', 'wordpoints'); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
25 | 25 | * @since 1.0.0 |
26 | 26 | */ |
27 | 27 | public function get_description() { |
28 | - return __( 'When a logged-in user or guest visits the site.', 'wordpoints' ); |
|
28 | + return __('When a logged-in user or guest visits the site.', 'wordpoints'); |
|
29 | 29 | } |
30 | 30 | } |
31 | 31 |