Skip to content

Commit 340e89c

Browse files
committed
Remove unneeded arguments and methods from page controller file.
1 parent eb71aea commit 340e89c

File tree

2 files changed

+20
-115
lines changed

2 files changed

+20
-115
lines changed

config/services.yml

+2-11
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,9 @@ services:
44
arguments:
55
- '@config'
66
- '@controller.helper'
7-
- '@auth'
8-
- '@template'
9-
- '@dbal.conn'
10-
- '@request'
11-
- '@user'
12-
- '@pagination'
13-
- '%core.php_ext%'
14-
- '@path_helper'
15-
- '@ext.manager'
16-
- '%core.root_path%'
17-
- '@paybas.recenttopics.functions'
187
- '@language'
8+
- '@paybas.recenttopics.functions'
9+
1910
paybas.recenttopics.functions:
2011
class: paybas\recenttopics\core\recenttopics
2112
arguments:

controller/page_controller.php

+18-104
Original file line numberDiff line numberDiff line change
@@ -10,66 +10,28 @@
1010

1111
namespace paybas\recenttopics\controller;
1212

13+
use phpbb\config\config;
14+
use phpbb\controller\helper;
1315
use phpbb\language\language;
16+
use paybas\recenttopics\core\recenttopics;
17+
use Symfony\Component\HttpFoundation\Response;
1418

1519
class page_controller implements page_interface
1620
{
17-
/**
18-
* @var \phpbb\auth\auth
19-
*/
20-
protected $auth;
2121
/**
2222
* @var \phpbb\config\config
2323
*/
2424
protected $config;
25+
2526
/**
2627
* @var \phpbb\controller\helper
2728
*/
2829
protected $helper;
30+
2931
/**
30-
* @var \phpbb\template\template
31-
*/
32-
protected $template;
33-
/**
34-
* @var \phpbb\db\driver\driver_interface
35-
*/
36-
protected $db;
37-
/**
38-
* @var \phpbb\request\request
39-
*/
40-
protected $request;
41-
/**
42-
* @var \phpbb\user
43-
*/
44-
protected $user;
45-
/**
46-
* @var string
47-
*/
48-
protected $phpEx;
49-
/**
50-
* @var \phpbb\pagination
51-
*/
52-
protected $pagination;
53-
/**
54-
* @var \phpbb\extension\manager
55-
*/
56-
protected $phpbb_extension_manager;
57-
/**
58-
* @var string
59-
*/
60-
protected $ext_path;
61-
/**
62-
* @var string
63-
*/
64-
protected $ext_path_web;
65-
/**
66-
* @var string
67-
*/
68-
protected $ext_path_images;
69-
/**
70-
* @var string
32+
* @var language
7133
*/
72-
protected $root_path;
34+
protected $language;
7335

7436
/* @var recenttopics */
7537
protected $rt_functions;
@@ -79,72 +41,25 @@ class page_controller implements page_interface
7941
*/
8042
protected $response;
8143

82-
/**
83-
* @var language
84-
*/
85-
protected $language;
86-
87-
/**
88-
* @var string
89-
*/
90-
protected $php_ext;
91-
92-
/**
93-
* @var string
94-
*/
95-
protected $path_helper;
96-
9744
/**
9845
* page constructor.
9946
*
100-
* @param \phpbb\config\config $config
101-
* @param \phpbb\controller\helper $helper
102-
* @param \phpbb\auth\auth $auth
103-
* @param \phpbb\template\template $template
104-
* @param \phpbb\db\driver\driver_interface $db
105-
* @param \phpbb\request\request $request
106-
* @param \phpbb\user $user
107-
* @param \phpbb\pagination $pagination
108-
* @param $php_ext
109-
* @param \phpbb\path_helper $path_helper
110-
* @param \phpbb\extension\manager $phpbb_extension_manager
111-
* @param $root_path
112-
* @param \paybas\recenttopics\core\recenttopics $functions
113-
* @param \phpbb\language\language $language
47+
* @param \phpbb\config\config $config
48+
* @param \phpbb\controller\helper $helper
49+
* @param \phpbb\language\language $language
50+
* @param \paybas\recenttopics\core\recenttopics $functions
11451
*/
11552
public function __construct(
116-
\phpbb\config\config $config,
117-
\phpbb\controller\helper $helper,
118-
\phpbb\auth\auth $auth,
119-
\phpbb\template\template $template,
120-
\phpbb\db\driver\driver_interface $db,
121-
\phpbb\request\request $request,
122-
\phpbb\user $user,
123-
\phpbb\pagination $pagination,
124-
$php_ext,
125-
\phpbb\path_helper $path_helper,
126-
\phpbb\extension\manager $phpbb_extension_manager,
127-
$root_path,
128-
\paybas\recenttopics\core\recenttopics $functions,
129-
\phpbb\language\language $language
53+
config $config,
54+
helper $helper,
55+
language $language,
56+
recenttopics $functions
13057
)
13158
{
13259
$this->config = $config;
13360
$this->helper = $helper;
134-
$this->auth = $auth;
135-
$this->template = $template;
136-
$this->db = $db;
137-
$this->request = $request;
138-
$this->user = $user;
139-
$this->pagination = $pagination;
140-
$this->php_ext = $php_ext;
141-
$this->path_helper = $path_helper;
142-
$this->phpbb_extension_manager = $phpbb_extension_manager;
143-
$this->ext_path = $this->phpbb_extension_manager->get_extension_path('paybas/recenttopics', true);
144-
$this->ext_path_web = $this->path_helper->get_web_root_path();
145-
$this->root_path = $root_path;
146-
$this->rt_functions = $functions;
14761
$this->language = $language;
62+
$this->rt_functions = $functions;
14863
}
14964

15065
/**
@@ -156,8 +71,7 @@ public function __construct(
15671
public function display()
15772
{
15873
$page = "recent_topics_page.html";
159-
$this->language->add_lang('info_acp_recenttopics', 'paybas/recenttopics');
160-
$this->language->add_lang('recenttopics', 'paybas/recenttopics');
74+
$this->language->add_lang(['info_acp_recenttopics', 'recenttopics'], 'paybas/recenttopics');
16175

16276
if (isset($this->config['rt_index']) && $this->config['rt_index'])
16377
{

0 commit comments

Comments
 (0)