public/main/inc/lib/import.lib.php
Missing class import via use statement (line '73', column '23'). Open
Open
$reader = new \PhpOffice\PhpSpreadsheet\Reader\Xls();
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid unused parameters such as '$setFirstRowAsHeader'. Open
Open
public static function csv_reader($path, $setFirstRowAsHeader = true)
- 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
Method name "Import::csv_reader" is not in camel caps format Open
Open
public static function csv_reader($path, $setFirstRowAsHeader = true)
- Exclude checks
The method csv_reader is not named in camelCase. Open
Open
public static function csv_reader($path, $setFirstRowAsHeader = true)
{
return self::csvToArray($path);
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}