Avoid using undefined variables such as '$app' which will lead to PHP notices. Open
$app['displaySampleButton'] = 1;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$app' which will lead to PHP notices. Open
$app['displaySampleButton'] = 0;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$app' which will lead to PHP notices. Open
Yaml::save($app, $yamlFile);
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$app' which will lead to PHP notices. Open
Yaml::save($app, $yamlFile);
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using static access to class '\Xmf\Yaml' in method 'showButtons'. Open
Yaml::save($app, $yamlFile);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Xmf\Yaml' in method 'hideButtons'. Open
Yaml::save($app, $yamlFile);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Avoid using static access to class '\Xmf\Yaml' in method 'loadAdminConfig'. Open
$config = Yaml::readWrapped($yamlFile); // work with phpmyadmin YAML dumps
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 99 and the first side effect is on line 26. Open
<?php
- Exclude checks
Expected 1 blank line at end of file; 2 found Open
require __DIR__ . '/admin_footer.php';
- Exclude checks
Line exceeds 120 characters; contains 155 characters Open
$adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'SAVE_SAMPLEDATA'), '__DIR__ . /../../testdata/index.php?op=save', 'add');
- Exclude checks
Line exceeds 120 characters; contains 170 characters Open
$adminObject->addInfoBoxLine(sprintf(MD_XFGUESTBOOK_MSGMODERATE, "<span style='color: #008012; font-weight: bold;'>" . $totalModerateMsgs . '</span>'), '', 'green');
- Exclude checks
Line exceeds 120 characters; contains 154 characters Open
$adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'ADD_SAMPLEDATA'), '__DIR__ . /../../testdata/index.php?op=load', 'add');
- Exclude checks
Line exceeds 120 characters; contains 136 characters Open
$adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'SHOW_SAMPLEDATA_BUTTONS'), '?op=show_buttons', 'add');
- Exclude checks
Line exceeds 120 characters; contains 166 characters Open
$adminObject->addInfoBoxLine(sprintf(MD_XFGUESTBOOK_MSGWAITING, "<span style='color: #cb000b; font-weight: bold;'>" . $totalWaitingMsgs . '</span>'), '', 'red');
- Exclude checks
Line exceeds 120 characters; contains 168 characters Open
$adminObject->addInfoBoxLine(sprintf(MD_XFGUESTBOOK_MSGMODERATE, "<span style='color: #cb000b; font-weight: bold;'>" . $totalModerateMsgs . '</span>'), '', 'red');
- Exclude checks
Line exceeds 120 characters; contains 167 characters Open
$adminObject->addInfoBoxLine(sprintf(MD_XFGUESTBOOK_MSGWAITING, "<span style='color: #008012; font-weight: bold;'>" . $totalWaitingMsgs . '</span>'), '', 'green');
- Exclude checks
Line exceeds 120 characters; contains 167 characters Open
// $adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'EXPORT_SCHEMA'), '__DIR__ . /../../testdata/index.php?op=exportschema', 'add');
- Exclude checks
Line exceeds 120 characters; contains 139 characters Open
$adminObject->addItemButton(constant('CO_' . $moduleDirNameUpper . '_' . 'HIDE_SAMPLEDATA_BUTTONS'), '?op=hide_buttons', 'delete');
- Exclude checks