framework/core/Content.php
Avoid unused local variables such as '$_TPL'. Open
Open
$_TPL = $tplVariables;
- Read upRead up
- Exclude checks
UnusedLocalVariable
Since: 0.2
Detects when a local variable is declared and/or assigned, but not used.
Example
class Foo {
public function doSomething()
{
$i = 5; // Unused
}
}
Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable
The variable $_TPL is not named in camelCase. Open
Open
public static function render($tplPath, $tplVariables = []) {
$_TPL = $tplVariables;
ob_start();
include($tplPath);
- 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();
}
}