Skip to content

Commit d9baa1f

Browse files
committed
Code optimizations
Signed-off-by: Matt Friedman <maf675@gmail.com>
1 parent 9fbfd0e commit d9baa1f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

event/listener.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,16 @@ public function __construct(controller_helper $controller_helper, form_helper $f
7373
public function load_template_data()
7474
{
7575
$methods = $this->phpbb_notifications->get_subscription_methods();
76-
if (array_key_exists('notification.method.phpbb.wpn.webpush', $methods))
76+
$webpush_method = $methods['notification.method.phpbb.wpn.webpush'] ?? null;
77+
78+
if ($webpush_method !== null)
7779
{
7880
if (!$this->language->is_set('NOTIFICATION_METHOD_PHPBB_WPN_WEBPUSH'))
7981
{
8082
$this->language->add_lang('webpushnotifications_module_ucp', 'phpbb/webpushnotifications');
8183
}
82-
$template_ary = $methods['notification.method.phpbb.wpn.webpush']['method']->get_ucp_template_data($this->controller_helper, $this->form_helper);
84+
85+
$template_ary = $webpush_method['method']->get_ucp_template_data($this->controller_helper, $this->form_helper);
8386
$this->template->assign_vars($template_ary);
8487
}
8588
}

0 commit comments

Comments
 (0)