xoops_module_uninstall_publisher()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 9
rs 10
c 1
b 0
f 1
1
<?php declare(strict_types=1);
2
3
/*
4
 You may not change or alter any portion of this comment or credits
5
 of supporting developers from this source code or any supporting source code
6
 which is considered copyrighted (c) material of the original comment or credit authors.
7
8
 This program is distributed in the hope that it will be useful,
9
 but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
*/
12
/**
13
 * uninstall.php - cleanup on module uninstall
14
 *
15
 * @author          XOOPS Module Development Team
16
 * @copyright       {@link https://xoops.org 2001-2016 XOOPS Project}
17
 * @license         {@link GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html)}
18
 * @link            https://xoops.org XOOPS
19
 */
20
21
use XoopsModules\Publisher\{
22
    Helper,
23
    Utility
24
};
25
/** @var Helper $helper */
26
27
/**
28
 * Prepares system prior to attempting to uninstall module
29
 * @param XoopsModule $module {@link XoopsModule}
30
 *
31
 * @return bool true if ready to uninstall, false if not
32
 */
33
function xoops_module_pre_uninstall_publisher(\XoopsModule $module): bool
0 ignored issues
show
Unused Code introduced by
The parameter $module is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

33
function xoops_module_pre_uninstall_publisher(/** @scrutinizer ignore-unused */ \XoopsModule $module): bool

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
34
{
35
    // Do some synchronization if needed
36
    return true;
37
}
38
39
/**
40
 * Performs tasks required during uninstallation of the module
41
 * @param XoopsModule $module {@link XoopsModule}
42
 *
43
 * @return bool true if uninstallation successful, false if not
44
 */
45
function xoops_module_uninstall_publisher(\XoopsModule $module): bool
0 ignored issues
show
Unused Code introduced by
The parameter $module is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

45
function xoops_module_uninstall_publisher(/** @scrutinizer ignore-unused */ \XoopsModule $module): bool

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
46
{
47
    //clean Cache
48
    Utility::cleanCache();
49
50
    // Rename uploads folder to BAK and add date to name
51
    $success = Utility::renameUploadFolder();
52
53
    return $success;
54
}
55