Skip to content

Commit 6c8c2af

Browse files
committed
PHP8 cosmetics, namespaces
1 parent 27cbdbf commit 6c8c2af

55 files changed

Lines changed: 254 additions & 126 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

abandongroup.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@
2020
*/
2121

2222
use Xmf\Request;
23-
use XoopsModules\Suico;
23+
use XoopsModules\Suico\{
24+
RelgroupuserHandler
25+
};
2426

2527
require __DIR__ . '/header.php';
2628
/**
@@ -50,7 +52,7 @@
5052
* Creating the factory and the criteria to delete the picture
5153
* The user must be the owner
5254
*/
53-
$relgroupuserFactory = new Suico\RelgroupuserHandler(
55+
$relgroupuserFactory = new RelgroupuserHandler(
5456
$xoopsDB
5557
);
5658
$criteria_rel_id = new Criteria('rel_id', $relgroupuser_id);

admin/admin_header.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,13 @@
2020
*/
2121

2222
use Xmf\Module\Admin;
23-
use XoopsModules\Suico\Helper;
24-
use XoopsModules\Suico\Utility;
23+
use XoopsModules\Suico\{
24+
Helper,
25+
Utility
26+
};
27+
/** @var Helper $helper */
28+
/** @var Utility $utility */
29+
/** @var Admin $adminObject */
2530

2631
include dirname(__DIR__) . '/preloads/autoloader.php';
2732
require dirname(__DIR__, 3) . '/include/cp_header.php';

admin/feedback.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,14 @@
2121

2222
use Xmf\Module\Admin;
2323
use Xmf\Request;
24-
use XoopsModules\Suico;
25-
use XoopsModules\Suico\Common\ModuleFeedback;
24+
use XoopsModules\Suico\{
25+
Helper,
26+
Utility,
27+
Common\ModuleFeedback
28+
};
29+
/** @var Helper $helper */
30+
/** @var Utility $utility */
31+
/** @var Admin $adminObject */
2632

2733
require __DIR__ . '/admin_header.php';
2834
$adminObject = Admin::getInstance();

admin/index.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@
2222
use Xmf\Module\Admin;
2323
use Xmf\Request;
2424
use Xmf\Yaml;
25-
use XoopsModules\Suico\Common;
25+
use XoopsModules\Suico\{
26+
Common,
27+
Helper,
28+
Utility
29+
};
30+
31+
/** @var Admin $adminObject */
32+
/** @var Helper $helper */
33+
/** @var Utility $utility */
2634

2735
require __DIR__ . '/admin_header.php';
2836
// Display Admin header

admin/migrate.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@
1919
* @author Marcello Brandão aka Suico, Mamba, LioMJ <https://xoops.org>
2020
*/
2121

22+
use Xmf\Module\Admin;
2223
use Xmf\Request;
23-
use XoopsModules\Suico;
24-
use XoopsModules\Suico\Common\Migrate;
24+
use XoopsModules\Suico\{
25+
ommon\Configurator,
26+
Common\Migrate
27+
};
28+
/** @var Admin $adminObject */
2529

2630
require_once __DIR__ . '/admin_header.php';
2731
xoops_cp_header();
@@ -40,7 +44,7 @@
4044
</form>
4145
EOF;
4246
//XoopsLoad::load('migrate', 'newbb');
43-
$configurator = new Suico\Common\Configurator();
47+
$configurator = new Configurator();
4448
$migrator = new Migrate($configurator);
4549
$op = Request::getCmd('op', 'default');
4650
$opShow = Request::getCmd('show', null, 'POST');

album.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@
2020
*/
2121

2222
use Xmf\Request;
23-
use XoopsModules\Suico;
23+
use XoopsModules\Suico\{
24+
PhotosController
25+
};
2426

2527
const COUNTPHOTOS = 'countPhotos';
2628
$GLOBALS['xoopsOption']['template_main'] = 'suico_album.tpl';
2729
require __DIR__ . '/header.php';
28-
$controller = new Suico\PhotosController($xoopsDB, $xoopsUser);
30+
$controller = new PhotosController($xoopsDB, $xoopsUser);
2931
/**
3032
* Fetching numbers of groups friends videos pictures etc...
3133
*/

audios.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@
1919
*/
2020

2121
use Xmf\Request;
22-
use XoopsModules\Suico;
22+
use XoopsModules\Suico\{
23+
AudioController
24+
};
2325

2426
const COUNTAUDIOS = 'countAudios';
2527
$GLOBALS['xoopsOption']['template_main'] = 'suico_audios.tpl';
2628
require __DIR__ . '/header.php';
27-
$controller = new Suico\AudioController($xoopsDB, $xoopsUser);
29+
$controller = new AudioController($xoopsDB, $xoopsUser);
2830
/**
2931
* Fetching numbers of groups friends videos pictures etc...
3032
*/

avatar.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@
2020
*/
2121

2222
use Xmf\Request;
23-
use XoopsModules\Suico;
23+
use XoopsModules\Suico\{
24+
Image,
25+
ImageHandler
26+
};
27+
/** @var Image $picture */
2428

2529
require __DIR__ . '/header.php';
2630
if (!$GLOBALS['xoopsSecurity']->check()) {
@@ -29,10 +33,9 @@
2933
/**
3034
* Creating the factory loading the picture changing its caption
3135
*/
32-
$imageFactory = new Suico\ImageHandler(
36+
$imageFactory = new ImageHandler(
3337
$xoopsDB
3438
);
35-
/** @var \XoopsModules\Suico\Image $picture */
3639
$picture = $imageFactory->create(false);
3740
$picture->load(Request::getString('image_id', '', 'POST'));
3841
$uid = (int)$xoopsUser->getVar('uid');

becomemembergroup.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020
*/
2121

2222
use Xmf\Request;
23-
use XoopsModules\Suico;
23+
use XoopsModules\Suico\{
24+
RelgroupuserHandler,
25+
GroupsHandler
26+
};
2427

2528
require __DIR__ . '/header.php';
2629
//require_once __DIR__ . '/class/Friendrequest.php';
@@ -29,10 +32,10 @@
2932
/**
3033
* Factories of groups... testing for zend editor
3134
*/
32-
$relgroupuserFactory = new Suico\RelgroupuserHandler(
35+
$relgroupuserFactory = new RelgroupuserHandler(
3336
$xoopsDB
3437
);
35-
$groupsFactory = new Suico\GroupsHandler($xoopsDB);
38+
$groupsFactory = new GroupsHandler($xoopsDB);
3639
$group_id = Request::getInt('group_id', 0, 'POST');
3740
$uid = (int)$xoopsUser->getVar('uid');
3841
$criteriaUid = new Criteria('rel_user_uid', $uid);

cancelFriendrequest.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,17 @@
2020
*/
2121

2222
use Xmf\Request;
23-
use XoopsModules\Suico;
23+
use XoopsModules\Suico\{
24+
FriendrequestHandler,
25+
FriendshipHandler
26+
};
2427

2528
require __DIR__ . '/header.php';
2629
/**
2730
* Factory of friendrequests created
2831
*/
29-
$friendrequestFactory = new Suico\FriendrequestHandler($xoopsDB);
30-
$friendshipFactory = new Suico\FriendshipHandler($xoopsDB);
32+
$friendrequestFactory = new FriendrequestHandler($xoopsDB);
33+
$friendshipFactory = new FriendshipHandler($xoopsDB);
3134
/**
3235
* Getting the uid of the user which user want to canel friend request
3336
*/

0 commit comments

Comments
 (0)