Skip to content

Commit 826d52a

Browse files
committed
Remove unused path helpers
1 parent 349c113 commit 826d52a

File tree

6 files changed

+5
-49
lines changed

6 files changed

+5
-49
lines changed

config/services.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ services:
3333
- '@log'
3434
- '@user_loader'
3535
- '@user'
36-
- '@path_helper'
3736
- '%core.root_path%'
3837
- '%core.php_ext%'
3938
- '%tables.phpbb.wpn.notification_push%'
@@ -62,5 +61,4 @@ services:
6261
class: phpbb\webpushnotifications\controller\manifest
6362
arguments:
6463
- '@config'
65-
- '@path_helper'
6664
- '@user'

controller/manifest.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
namespace phpbb\webpushnotifications\controller;
1212

1313
use phpbb\config\config;
14-
use phpbb\path_helper;
1514
use phpbb\user;
1615
use phpbb\webpushnotifications\ext;
1716
use Symfony\Component\HttpFoundation\JsonResponse;
@@ -21,23 +20,18 @@ class manifest
2120
/** @var config */
2221
protected $config;
2322

24-
/** @var path_helper */
25-
protected $path_helper;
26-
2723
/** @var user */
2824
protected $user;
2925

3026
/**
3127
* Constructor for webpush controller
3228
*
3329
* @param config $config
34-
* @param path_helper $path_helper
3530
* @param user $user
3631
*/
37-
public function __construct(config $config, path_helper $path_helper, user $user)
32+
public function __construct(config $config, user $user)
3833
{
3934
$this->config = $config;
40-
$this->path_helper = $path_helper;
4135
$this->user = $user;
4236
}
4337

notification/method/webpush.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use phpbb\log\log_interface;
1818
use phpbb\notification\method\base;
1919
use phpbb\notification\type\type_interface;
20-
use phpbb\path_helper;
2120
use phpbb\user;
2221
use phpbb\user_loader;
2322
use phpbb\webpushnotifications\form\form_helper;
@@ -44,9 +43,6 @@ class webpush extends base implements extended_method_interface
4443
/** @var user */
4544
protected $user;
4645

47-
/** @var path_helper */
48-
protected $path_helper;
49-
5046
/** @var string */
5147
protected $phpbb_root_path;
5248

@@ -73,21 +69,19 @@ class webpush extends base implements extended_method_interface
7369
* @param log_interface $log
7470
* @param user_loader $user_loader
7571
* @param user $user
76-
* @param path_helper $path_helper
7772
* @param string $phpbb_root_path
7873
* @param string $php_ext
7974
* @param string $notification_webpush_table
8075
* @param string $push_subscriptions_table
8176
*/
82-
public function __construct(config $config, driver_interface $db, log_interface $log, user_loader $user_loader, user $user, path_helper $path_helper,
77+
public function __construct(config $config, driver_interface $db, log_interface $log, user_loader $user_loader, user $user,
8378
string $phpbb_root_path, string $php_ext, string $notification_webpush_table, string $push_subscriptions_table)
8479
{
8580
$this->config = $config;
8681
$this->db = $db;
8782
$this->log = $log;
8883
$this->user_loader = $user_loader;
8984
$this->user = $user;
90-
$this->path_helper = $path_helper;
9185
$this->phpbb_root_path = $phpbb_root_path;
9286
$this->php_ext = $php_ext;
9387
$this->notification_webpush_table = $notification_webpush_table;

tests/controller/controller_manifest_test.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,12 @@
1515
class controller_manifest_test extends \phpbb_test_case
1616
{
1717
protected $config;
18-
protected $path_helper;
1918
protected $user;
2019
protected $manifest;
2120

2221
protected function setUp(): void
2322
{
24-
global $phpbb_root_path, $phpEx;
25-
global $config, $user, $request, $symfony_request;
23+
global $config, $user, $phpbb_root_path, $phpEx;
2624

2725
parent::setUp();
2826

@@ -38,15 +36,8 @@ protected function setUp(): void
3836
$lang_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx);
3937
$language = new \phpbb\language\language($lang_loader);
4038
$user = $this->user = new \phpbb\user($language, '\phpbb\datetime');
41-
$symfony_request = $this->createMock(\phpbb\symfony_request::class);
42-
$request = $this->request = $this->createMock(\phpbb\request\request_interface::class);
43-
$this->path_helper = new \phpbb\path_helper($symfony_request, new \phpbb\filesystem\filesystem(), $this->request, $phpbb_root_path, $phpEx);
44-
45-
$this->manifest = new \phpbb\webpushnotifications\controller\manifest(
46-
$this->config,
47-
$this->path_helper,
48-
$this->user
49-
);
39+
40+
$this->manifest = new \phpbb\webpushnotifications\controller\manifest($this->config, $this->user);
5041
}
5142

5243
public function manifest_data()

tests/event/listener_test.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,6 @@ protected function setUp(): void
9595
$this->user
9696
);
9797

98-
$path_helper = $this->getMockBuilder('\phpbb\path_helper')
99-
->disableOriginalConstructor()
100-
->setMethods(array())
101-
->getMock();
102-
10398
$this->notifications = $this->getMockBuilder('\phpbb\notification\manager')
10499
->disableOriginalConstructor()
105100
->getMock();
@@ -113,7 +108,6 @@ protected function setUp(): void
113108
new \phpbb\log\dummy(),
114109
$user_loader,
115110
$this->user,
116-
$path_helper,
117111
$phpbb_root_path,
118112
$phpEx,
119113
'phpbb_wpn_notification_push',

tests/notification/notification_method_webpush_test.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -128,19 +128,6 @@ protected function setUp(): void
128128
$phpEx
129129
);
130130

131-
$request = new \phpbb_mock_request;
132-
$symfony_request = new \phpbb\symfony_request(
133-
$request
134-
);
135-
$filesystem = new \phpbb\filesystem\filesystem();
136-
$phpbb_path_helper = new \phpbb\path_helper(
137-
$symfony_request,
138-
$filesystem,
139-
$request,
140-
$phpbb_root_path,
141-
$phpEx
142-
);
143-
144131
$log_table = 'phpbb_log';
145132
$this->log = new \phpbb\log\log($this->db, $user, $auth, $this->phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, $log_table);
146133

@@ -158,7 +145,6 @@ protected function setUp(): void
158145
$phpbb_container->set('log', $this->log);
159146
$phpbb_container->set('text_formatter.utils', new \phpbb\textformatter\s9e\utils());
160147
$phpbb_container->set('dispatcher', $this->phpbb_dispatcher);
161-
$phpbb_container->set('path_helper', $phpbb_path_helper);
162148
$phpbb_container->setParameter('core.root_path', $phpbb_root_path);
163149
$phpbb_container->setParameter('core.php_ext', $phpEx);
164150
$phpbb_container->setParameter('tables.notifications', 'phpbb_notifications');
@@ -174,7 +160,6 @@ protected function setUp(): void
174160
$phpbb_container->get('log'),
175161
$phpbb_container->get('user_loader'),
176162
$phpbb_container->get('user'),
177-
$phpbb_container->get('path_helper'),
178163
$phpbb_root_path,
179164
$phpEx,
180165
$phpbb_container->getParameter('tables.phpbb.wpn.notification_push'),

0 commit comments

Comments
 (0)