include/oninstall.php
xoops_module_pre_install_gbook accesses the super-global variable $GLOBALS. Open
Open
function xoops_module_pre_install_gbook(\XoopsModule $module)
{
$utility = new Gbook\Utility();
//check for minimum XOOPS version
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
xoops_module_pre_install_gbook accesses the super-global variable $GLOBALS. Open
Open
function xoops_module_pre_install_gbook(\XoopsModule $module)
{
$utility = new Gbook\Utility();
//check for minimum XOOPS version
- Read upRead up
- Exclude checks
Superglobals
Since: 0.2
Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.
Example
class Foo {
public function bar() {
$name = $_POST['foo'];
}
}
Source
Avoid unused parameters such as '$module'. Open
Open
function xoops_module_install_gbook(\XoopsModule $module)
- Read upRead up
- Exclude checks
UnusedFormalParameter
Since: 0.2
Avoid passing parameters to methods or constructors and then not using those parameters.
Example
class Foo
{
private function bar($howdy)
{
// $howdy is not used
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter
The variable $mod_tables is not named in camelCase. Open
Open
function xoops_module_pre_install_gbook(\XoopsModule $module)
{
$utility = new Gbook\Utility();
//check for minimum XOOPS version
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $mod_tables is not named in camelCase. Open
Open
function xoops_module_pre_install_gbook(\XoopsModule $module)
{
$utility = new Gbook\Utility();
//check for minimum XOOPS version
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}