Completed
Push — master ( 8786b6...8e35b4 )
by Michael
8s
created

oninstall.php ➔ xoops_module_pre_install_randomquote()   A

Complexity

Conditions 4
Paths 6

Size

Total Lines 17
Code Lines 8

Duplication

Lines 17
Ratio 100 %

Importance

Changes 1
Bugs 1 Features 1
Metric Value
cc 4
eloc 8
c 1
b 1
f 1
nc 6
nop 1
dl 17
loc 17
rs 9.2
1
<?php
2
/*
3
 You may not change or alter any portion of this comment or credits of
4
 supporting developers from this source code or any supporting source code
5
 which is considered copyrighted (c) material of the original comment or credit
6
 authors.
7
8
 This program is distributed in the hope that it will be useful, but
9
 WITHOUT ANY WARRANTY; without even the implied warranty of
10
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11
 */
12
/**
13
 * Module: RandomQuote
14
 *
15
 * @category        Module
16
 * @package         randomquote
17
 * @author          XOOPS Module Development Team
18
 * @author          Mamba
19
 * @copyright       {@link http://xoops.org 2001-2016 XOOPS Project}
20
 * @license         {@link http://www.fsf.org/copyleft/gpl.html GNU public license}
21
 * @link            http://xoops.org XOOPS
22
 * @since           2.00
23
 */
24
25
/**
26
 *
27
 * Prepares system prior to attempting to install module
28
 * @param obj $module {@link XoopsModule}
29
 *
30
 * @return bool true if ready to install, false if not
31
 */
32 View Code Duplication
function xoops_module_pre_install_randomquote(&$module)
0 ignored issues
show
Duplication introduced by
This function seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
33
{
34
35
    if (!class_exists('RandomquoteUtilities')) {
36
        xoops_load('utilities', 'randomquote');
37
    }
38
    //check for minimum XOOPS version
39
    if (!RandomquoteUtilities::checkXoopsVer($module)) {
40
        return false;
41
    }
42
43
    // check for minimum PHP version
44
    if (!RandomquoteUtilities::checkPHPVer($module)) {
45
        return false;
46
    }
47
    return true;
48
}
49
50
/**
51
 *
52
 * Performs tasks required during installation of the module
53
 * @param obj $module {@link XoopsModule}
54
 *
55
 * @return bool true if installation successful, false if not
56
 */
57
function xoops_module_install_randomquote(&$module) {
0 ignored issues
show
Unused Code introduced by
The parameter $module is not used and could be removed.

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

Loading history...
58
    return true;
59
}
60