phplrt/phplrt

View on GitHub
libs/lexer/src/Printer/PrettyPrinter.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid unused parameters such as '$token'.
Open

    private function printEoiToken(TokenInterface $token): string

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

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

        [$from, $to] = [

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

Arguments with default values must be at the end of the argument list
Open

        private readonly string $eoi = self::DEFAULT_END_OF_INPUT,

Line indented incorrectly; expected 4 spaces, found 8
Open

        private readonly int $length = self::DEFAULT_LENGTH,

Line indented incorrectly; expected 4 spaces, found 8
Open

        private readonly string $wrapAtStart = self::DEFAULT_WRAP,

Line indented incorrectly; expected 4 spaces, found 8
Open

        private readonly string $wrapAtEnd = self::DEFAULT_WRAP,

Space before opening parenthesis of function call prohibited
Open

        return match ($token->getChannel()) {

Line indented incorrectly; expected 8 spaces, found 12
Open

            default => $this->printNonDefaultToken($token),

Line indented incorrectly; expected 4 spaces, found 8
Open

        private readonly string $suffix = self::DEFAULT_OVERFLOW_SUFFIX,

Line indented incorrectly; expected 4 spaces, found 8
Open

        private readonly array $replacements = self::DEFAULT_REPLACEMENTS,

Line indented incorrectly; expected 4 spaces, found 8
Open

        private readonly string $eoi = self::DEFAULT_END_OF_INPUT,

There are no issues that match your filters.

Category
Status