heiglandreas/DateFormatter

View on GitHub

Showing 2 of 2 total issues

Avoid using static access to class '\Org_Heigl\DateFormatter\Service\FormatterService' in method '__construct'.
Open

            $format = FormatterService::getFormatter($format);
Severity: Minor
Found in src/DateFormatter.php by phpmd

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 unused local variables such as '$path'.
Open

        foreach (self::getList() as $class => $path) {
Severity: Minor
Found in src/Service/FormatterService.php by phpmd

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

Severity
Category
Status
Source
Language