YetiForceCompany/YetiForcePDF

View on GitHub
lib/Style/Normalizer/Background.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using static access to class '\YetiForcePDF\Style\Normalizer\Normalizer' in method 'normalize'.
Open

        $normalizerName = \YetiForcePDF\Style\Normalizer\Normalizer::getNormalizerClassName('background-color');
Severity: Minor
Found in lib/Style/Normalizer/Background.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

Spaces must be used to indent lines; tabs are not allowed
Open

            ->init()

Spaces must be used to indent lines; tabs are not allowed
Open

        return (new $normalizerName())

Spaces must be used to indent lines; tabs are not allowed
Open

        $normalizerName = \YetiForcePDF\Style\Normalizer\Normalizer::getNormalizerClassName('background-color');

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

            ->setDocument($this->document)

Spaces must be used to indent lines; tabs are not allowed
Open

            ->normalize($ruleValue, $ruleName);

Spaces must be used to indent lines; tabs are not allowed
Open

    public function normalize($ruleValue, string $ruleName = ''): array

Spaces must be used to indent lines; tabs are not allowed
Open

            ->setStyle($this->style)

Spaces must be used to indent lines; tabs are not allowed
Open

    }

There are no issues that match your filters.

Category
Status