Skip to content

Commit 4d8b9ca

Browse files
author
Dark❶
committed
Fix 2.0.2
- Code Sniff Changes Signed-off-by: Dark❶ <dark-1@users.noreply.github.com>
1 parent 56e726d commit 4d8b9ca

File tree

3 files changed

+64
-52
lines changed

3 files changed

+64
-52
lines changed

acp/usu.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function main($id, $mode)
147147
$i = 2;
148148
$display_vars['vars']['legend1'] = 'ACP_PHPBB_SEO_CLASS';
149149

150-
foreach($this->core->cache_config['dynamic_options'] as $optionname => $optionvalue)
150+
foreach ($this->core->cache_config['dynamic_options'] as $optionname => $optionvalue)
151151
{
152152
if (@is_bool($this->core->seo_opt[$optionvalue]))
153153
{
@@ -242,7 +242,7 @@ function main($id, $mode)
242242

243243
$forum_url_title = $error_cust = '';
244244

245-
while($row = $this->db->sql_fetchrow($result))
245+
while ($row = $this->db->sql_fetchrow($result))
246246
{
247247
$this->forum_ids[$row['forum_id']] = $row['forum_name'];
248248
}
@@ -326,7 +326,7 @@ function main($id, $mode)
326326
case 'server':
327327

328328
$display_vars['title'] = 'ACP_REWRITE_CONF';
329-
$display_vars['ACP_REWRITE_CONF_EXPLAIN'] = $this->language->lang('ACP_REWRITE_CONF_EXPLAIN') . '</p><hr/><p><b>' . $this->language->lang('ACP_PHPBB_SEO_VERSION') . ' : ' . $this->modrtype_lang['link'] . ' - ( ' . $this->modrtype_lang['forumlink'] . ' )</b></p><p>';
329+
$display_vars['ACP_REWRITE_CONF_EXPLAIN'] = $this->language->lang('ACP_REWRITE_CONF_EXPLAIN') . '</p><hr/><p><b>' . $this->language->lang('ACP_PHPBB_SEO_VERSION') . ' : ' . $this->modrtype_lang['link'] . ' - ( ' . $this->modrtype_lang['forumlink'] . ' )</b></p><p>';
330330

331331
$display_vars['vars'] = [];
332332
$display_vars['vars']['legend1'] = 'ACP_REWRITE_CONF';
@@ -597,7 +597,7 @@ function main($id, $mode)
597597
$m_values = utf8_normalize_nfc($this->request->variable('multiple_' . $config_name, ['' => '']));
598598
$validate_int = !empty($cfg_setup['multiple_validate']) && $cfg_setup['multiple_validate'] == 'int' ? true : false;
599599

600-
foreach($m_values as $k => $v)
600+
foreach ($m_values as $k => $v)
601601
{
602602
if ($validate_int)
603603
{
@@ -1601,7 +1601,7 @@ function get_mods_server_conf()
16011601
return false;
16021602
}
16031603

1604-
while(($file = @readdir($dir)) !== false)
1604+
while (($file = @readdir($dir)) !== false)
16051605
{
16061606
if (!trim($file, '. '))
16071607
{
@@ -1754,7 +1754,7 @@ function check_cache_folder($cache_dir, $msg = true)
17541754
// let's check all files
17551755
$inner_write = true;
17561756

1757-
foreach($checks as $check)
1757+
foreach ($checks as $check)
17581758
{
17591759
if (file_exists($check))
17601760
{
@@ -1797,7 +1797,7 @@ function check_cache_folder($cache_dir, $msg = true)
17971797
*/
17981798
function write_cache($file, $update)
17991799
{
1800-
if(!$this->core->cache_config['cache_enable'])
1800+
if (!$this->core->cache_config['cache_enable'])
18011801
{
18021802
return false;
18031803
}
@@ -1852,7 +1852,7 @@ function forum_select($ignore_acl = true, $ignore_nonpost = false, $ignore_empty
18521852
{
18531853
$select_ary = make_forum_select(false, false, $ignore_acl, $ignore_nonpost, $ignore_emptycat, $only_acl_post, true);
18541854

1855-
foreach($select_ary as $f_id => $f_data)
1855+
foreach ($select_ary as $f_id => $f_data)
18561856
{
18571857
$select_ary[$f_id] = [
18581858
'title' => $f_data['padding'] . $f_data['forum_name'],

core/core.php

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,38 @@
1010

1111
namespace phpbbseo\usu\core;
1212

13+
/**
14+
* @ignore
15+
*/
16+
use phpbb\config\config;
17+
use phpbb\request\request;
18+
use phpbb\user;
19+
use phpbb\auth\auth;
20+
1321
/**
1422
* core Class
1523
* www.phpBB-SEO.ir
1624
* @package Ultimate phpBB SEO Friendly URL
1725
*/
1826
class core
1927
{
20-
/* @var \phpbb\config\config */
28+
/**
29+
* Import All Trait
30+
*/
31+
use customise, rewriter, url, seo, get_set;
32+
33+
/** @var config */
2134
private $config;
2235

23-
/* @var \phpbb\request\request */
36+
/** @var request */
2437
private $request;
2538

26-
/* @var \phpbb\user */
39+
/** @var user */
2740
private $user;
2841

29-
/** @var \phpbb\auth\auth */
42+
/** @var auth */
3043
private $auth;
3144

32-
/* @var \phpbbseo\usu\customise */
33-
private $customise;
34-
35-
/* @var \phpbbseo\usu\rewriter */
36-
private $rewriter;
37-
3845
/**
3946
* Current $phpbb_root_path
4047
* @var string
@@ -221,23 +228,18 @@ class core
221228
public $url_in = '';
222229
public $url = '';
223230

224-
/**
225-
* Import All Trait
226-
*/
227-
use customise, rewriter, url, seo, get_set;
228-
229231
/**
230232
* Constructor
231233
*
232-
* @param \phpbb\config\config $config Config object
233-
* @param \phpbb\request\request $request Request object
234-
* @param \phpbb\user $user User object
235-
* @param \phpbb\auth\auth $auth Auth object
236-
* @param string $phpbb_root_path Path to the phpBB root
237-
* @param string $php_ext PHP file extension
234+
* @param config $config Config object
235+
* @param request $request Request object
236+
* @param user $user User object
237+
* @param auth $auth Auth object
238+
* @param string $phpbb_root_path Path to the phpBB root
239+
* @param string $php_ext PHP file extension
238240
*
239241
*/
240-
public function __construct(\phpbb\config\config $config, \phpbb\request\request $request, \phpbb\user $user, \phpbb\auth\auth $auth, $phpbb_root_path, $php_ext)
242+
public function __construct(config $config, request $request, user $user, auth $auth, $phpbb_root_path, $php_ext)
241243
{
242244
$this->config = $config;
243245
$this->request = $request;

event/listener.php

Lines changed: 32 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,43 @@
1414
* @ignore
1515
*/
1616
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
17+
use phpbbseo\usu\core\core;
18+
use phpbb\config\config;
19+
use phpbb\auth\auth;
20+
use phpbb\template\template;
21+
use phpbb\user;
22+
use phpbb\request\request;
23+
use phpbb\db\driver\driver_interface as db_driver;
24+
use phpbb\language\language;
1725

1826
/**
1927
* Event listener
2028
*/
2129
class listener implements EventSubscriberInterface
2230
{
23-
/* @var \phpbbseo\usu\core\core */
31+
/** @var core */
2432
private $core;
2533

26-
/* @var \phpbb\config\config */
34+
/** @var config */
2735
private $config;
2836

29-
/** @var \phpbb\auth\auth */
37+
/** @var auth */
3038
private $auth;
3139

32-
/* @var \phpbb\template\template */
40+
/** @var template */
3341
private $template;
3442

35-
/* @var \phpbb\user */
43+
/** @var user */
3644
private $user;
3745

38-
/* @var \phpbb\request\request */
46+
/** @var request */
3947
private $request;
4048

41-
/* @var \phpbb\db\driver\driver_interface */
49+
/** @var db_driver */
4250
private $db;
4351

44-
/** @var \phpbb\language\language */
45-
private $language;
52+
/** @var language */
53+
private $language;
4654

4755
/**
4856
* Current $phpbb_root_path
@@ -69,18 +77,19 @@ class listener implements EventSubscriberInterface
6977
/**
7078
* Constructor
7179
*
72-
* @param \phpbbseo\usu\core\core $core
73-
* @param \phpbb\config\config $config Config object
74-
* @param \phpbb\auth\auth $auth Auth object
75-
* @param \phpbb\template\template $template Template object
76-
* @param \phpbb\user $user User object
77-
* @param \phpbb\request\request $request Request object
78-
* @param \phpbb\db\driver\driver_interface $db Database object
79-
* @param string $phpbb_root_path Path to the phpBB root
80-
* @param string $php_ext PHP file extension
80+
* @param core $core
81+
* @param config $config Config object
82+
* @param auth $auth Auth object
83+
* @param template $template Template object
84+
* @param user $user User object
85+
* @param request $request Request object
86+
* @param db_driver $db Database object
87+
* @param language $language Language object
88+
* @param string $phpbb_root_path Path to the phpBB root
89+
* @param string $php_ext PHP file extension
8190
*
8291
*/
83-
public function __construct(\phpbbseo\usu\core\core $core, \phpbb\config\config $config, \phpbb\auth\auth $auth, \phpbb\template\template $template, \phpbb\user $user, \phpbb\request\request $request, \phpbb\db\driver\driver_interface $db, \phpbb\language\language $language, $phpbb_root_path, $php_ext)
92+
public function __construct(core $core, config $config, auth $auth, template $template, user $user, request $request, db_driver $db, language $language, $phpbb_root_path, $php_ext)
8493
{
8594
$this->core = $core;
8695
$this->template = $template;
@@ -123,7 +132,7 @@ public function core_user_setup($event)
123132

124133
$user_data = $event['user_data'];
125134

126-
switch($this->core->seo_opt['req_file'])
135+
switch ($this->core->seo_opt['req_file'])
127136
{
128137
case 'viewforum':
129138
global $forum_data; // god save the hax
@@ -376,7 +385,7 @@ public function core_common($event)
376385

377386
$this->start = max(0, $this->request->variable('start', 0));
378387

379-
switch($this->core->seo_opt['req_file'])
388+
switch ($this->core->seo_opt['req_file'])
380389
{
381390
case 'viewforum':
382391
$this->forum_id = max(0, $this->request->variable('f', 0));
@@ -971,7 +980,8 @@ public function core_display_user_activity_modify_actives($event)
971980
$result = $this->db->sql_query($this->db->sql_build_query('SELECT', $sql_array));
972981
$seo_active_t_row = $this->db->sql_fetchrow($result);
973982
$this->db->sql_freeresult($result);
974-
if ($seo_active_t_row) {
983+
if ($seo_active_t_row)
984+
{
975985
$active_t_row = array_merge($active_t_row, $seo_active_t_row);
976986
$active_t_forum_id = (int) $active_t_row['forum_id'];
977987
$this->core->prepare_topic_url($active_t_row);

0 commit comments

Comments
 (0)