alexander-emelyanov/opteck-api-client

View on GitHub
src/Entities/Definition.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid variables with short names like $id. Configured minimum length is 3.
Open

    protected $id;
Severity: Minor
Found in src/Entities/Definition.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

The 'getIsActive()' method which returns a boolean should be named 'is...()' or 'has...()'
Open

    public function getIsActive()
    {
        return boolval(intval($this->isActive));
    }
Severity: Minor
Found in src/Entities/Definition.php by phpmd

BooleanGetMethodName

Since: 0.2

Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.

Example

class Foo {
    /**
     * @return boolean
     */
    public function getFoo() {} // bad
    /**
     * @return bool
     */
    public function isFoo(); // ok
    /**
     * @return boolean
     */
    public function getFoo($bar); // ok, unless checkParameterizedMethods=true
}

Source https://phpmd.org/rules/naming.html#booleangetmethodname

There are no issues that match your filters.

Category
Status