Skip to content

Commit 91bd183

Browse files
committed
Rename notification method to be more consistent with the core naming.
1 parent 841d983 commit 91bd183

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

config/services.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ services:
1919
tags:
2020
- { name: event.listener }
2121

22-
phpbb.wpn.notification.method.webpush:
22+
notification.method.phpbb.wpn.webpush:
2323
class: phpbb\webpushnotifications\notification\method\webpush
2424
shared: false
2525
arguments:

event/listener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function __construct(controller_helper $controller_helper, form_helper $f
6767
*/
6868
public function load_template_data($event)
6969
{
70-
if ($event['method_data']['id'] == 'phpbb.wpn.notification.method.webpush')
70+
if ($event['method_data']['id'] == 'notification.method.phpbb.wpn.webpush')
7171
{
7272
$template_ary = $event['method_data']['method']->get_ucp_template_data($this->controller_helper, $this->form_helper);
7373
$this->template->assign_vars($template_ary);

migrations/handle_subscriptions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ public function update_subscriptions()
5757
$sql = $core_webpush_exists ?
5858
'UPDATE ' . $user_notifications_table . "
5959
SET method = '" . $this->db->sql_escape('notification.method.webpush') . "'
60-
WHERE method = '" . $this->db->sql_escape('phpbb.wpn.notification.method.webpush') . "'" :
60+
WHERE method = '" . $this->db->sql_escape('notification.method.phpbb.wpn.webpush') . "'" :
6161

6262
'DELETE FROM ' . $user_notifications_table . "
63-
WHERE method = '" . $this->db->sql_escape('phpbb.wpn.notification.method.webpush') . "'";
63+
WHERE method = '" . $this->db->sql_escape('notification.method.phpbb.wpn.webpush') . "'";
6464

6565
$this->db->sql_query($sql);
6666
}

notification/method/webpush.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function __construct(config $config, driver_interface $db, log_interface
7878
*/
7979
public function get_type(): string
8080
{
81-
return 'phpbb.wpn.notification.method.webpush';
81+
return 'notification.method.phpbb.wpn.webpush';
8282
}
8383

8484
/**

tests/notification/fixtures/webpush_notification.type.post.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -188,98 +188,98 @@
188188
<value>notification.type.post</value>
189189
<value>0</value>
190190
<value>2</value>
191-
<value>phpbb.wpn.notification.method.webpush</value>
191+
<value>notification.method.phpbb.wpn.webpush</value>
192192
<value>1</value>
193193
</row>
194194
<row>
195195
<value>notification.type.post</value>
196196
<value>0</value>
197197
<value>3</value>
198-
<value>phpbb.wpn.notification.method.webpush</value>
198+
<value>notification.method.phpbb.wpn.webpush</value>
199199
<value>1</value>
200200
</row>
201201
<row>
202202
<value>notification.type.post</value>
203203
<value>0</value>
204204
<value>4</value>
205-
<value>phpbb.wpn.notification.method.webpush</value>
205+
<value>notification.method.phpbb.wpn.webpush</value>
206206
<value>1</value>
207207
</row>
208208
<row>
209209
<value>notification.type.post</value>
210210
<value>0</value>
211211
<value>5</value>
212-
<value>phpbb.wpn.notification.method.webpush</value>
212+
<value>notification.method.phpbb.wpn.webpush</value>
213213
<value>1</value>
214214
</row>
215215
<row>
216216
<value>notification.type.post</value>
217217
<value>0</value>
218218
<value>6</value>
219-
<value>phpbb.wpn.notification.method.webpush</value>
219+
<value>notification.method.phpbb.wpn.webpush</value>
220220
<value>1</value>
221221
</row>
222222
<row>
223223
<value>notification.type.post</value>
224224
<value>0</value>
225225
<value>7</value>
226-
<value>phpbb.wpn.notification.method.webpush</value>
226+
<value>notification.method.phpbb.wpn.webpush</value>
227227
<value>1</value>
228228
</row>
229229
<row>
230230
<value>notification.type.post</value>
231231
<value>0</value>
232232
<value>8</value>
233-
<value>phpbb.wpn.notification.method.webpush</value>
233+
<value>notification.method.phpbb.wpn.webpush</value>
234234
<value>1</value>
235235
</row>
236236
<row>
237237
<value>notification.type.forum</value>
238238
<value>0</value>
239239
<value>2</value>
240-
<value>phpbb.wpn.notification.method.webpush</value>
240+
<value>notification.method.phpbb.wpn.webpush</value>
241241
<value>1</value>
242242
</row>
243243
<row>
244244
<value>notification.type.forum</value>
245245
<value>0</value>
246246
<value>3</value>
247-
<value>phpbb.wpn.notification.method.webpush</value>
247+
<value>notification.method.phpbb.wpn.webpush</value>
248248
<value>1</value>
249249
</row>
250250
<row>
251251
<value>notification.type.forum</value>
252252
<value>0</value>
253253
<value>4</value>
254-
<value>phpbb.wpn.notification.method.webpush</value>
254+
<value>notification.method.phpbb.wpn.webpush</value>
255255
<value>1</value>
256256
</row>
257257
<row>
258258
<value>notification.type.forum</value>
259259
<value>0</value>
260260
<value>5</value>
261-
<value>phpbb.wpn.notification.method.webpush</value>
261+
<value>notification.method.phpbb.wpn.webpush</value>
262262
<value>1</value>
263263
</row>
264264
<row>
265265
<value>notification.type.forum</value>
266266
<value>0</value>
267267
<value>6</value>
268-
<value>phpbb.wpn.notification.method.webpush</value>
268+
<value>notification.method.phpbb.wpn.webpush</value>
269269
<value>1</value>
270270
</row>
271271
<row>
272272
<value>notification.type.forum</value>
273273
<value>0</value>
274274
<value>7</value>
275-
<value>phpbb.wpn.notification.method.webpush</value>
275+
<value>notification.method.phpbb.wpn.webpush</value>
276276
<value>1</value>
277277
</row>
278278
<row>
279279
<value>notification.type.forum</value>
280280
<value>0</value>
281281
<value>8</value>
282-
<value>phpbb.wpn.notification.method.webpush</value>
282+
<value>notification.method.phpbb.wpn.webpush</value>
283283
<value>1</value>
284284
</row>
285285
</table>

tests/notification/notification_method_webpush_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function getDataSet()
4646
protected function get_notification_methods()
4747
{
4848
return [
49-
'phpbb.wpn.notification.method.webpush',
49+
'notification.method.phpbb.wpn.webpush',
5050
];
5151
}
5252

@@ -157,7 +157,7 @@ protected function setUp(): void
157157
$phpbb_container->getParameter('tables.phpbb.wpn.push_subscriptions')
158158
);
159159

160-
$phpbb_container->set('phpbb.wpn.notification.method.webpush', $this->notification_method_webpush);
160+
$phpbb_container->set('notification.method.phpbb.wpn.webpush', $this->notification_method_webpush);
161161

162162
$this->notifications = new \phpbb_notification_manager_helper(
163163
array(),

0 commit comments

Comments
 (0)