src/mrcnpdlk/MojePanstwo/Model/KrsPerson.php
The class KrsPerson has 16 fields. Consider redesigning KrsPerson to keep the number of fields under 15. Open
Open
class KrsPerson extends ModelAbstract
{
const CONTEXT = 'krs_osoby';
const PULL_NONE = 0;
const PULL_KRS_ENTITIES = 1;
- Read upRead up
- Exclude checks
TooManyFields
Since: 0.1
Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.
Example
class Person {
protected $one;
private $two;
private $three;
[... many more fields ...]
}
Source https://phpmd.org/rules/codesize.html#toomanyfields
Missing class import via use statement (line '111', column '66'). Open
Open
$this->data_urodzenia = $this->data_urodzenia ? (new \DateTime($this->data_urodzenia))->format('Y-m-d') : null;
- 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 '$oLayers'. Open
Open
public function __construct(\stdClass $oData = null, \stdClass $oLayers = null)
- 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
}
}