phplrt/phplrt

View on GitHub

Showing 408 of 408 total issues

Opening brace of a interface must be on the line after the definition
Open

    \Countable {}

Opening brace of a interface must be on the line after the definition
Open

interface GrammarInterface extends ParserInterface {}

Opening brace of a interface must be on the line after the definition
Open

interface PreferContentReadingInterface {}

Opening brace of a interface must be on the line after the definition
Open

interface VirtualFileInterface extends FileInterface {}

The method with has a boolean flag argument $prepend, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function with(VisitorInterface $visitor, bool $prepend = false): self;

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method with has a boolean flag argument $prepend, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function with(VisitorInterface $visitor, bool $prepend = false): TraverserInterface
Severity: Minor
Found in libs/visitor/src/Traverser.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

The method __construct has a boolean flag argument $composite, which is a certain sign of a Single Responsibility Principle violation.
Open

        private readonly bool $composite = false,
Severity: Minor
Found in libs/lexer/src/Lexer.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

Remove error control operator '@' on line 108.
Open

    private function syncGetContents(): string
    {
        \error_clear_last();

        $result = @\stream_get_contents($this->stream);
Severity: Minor
Found in libs/source/src/Stream.php by phpmd

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

The method __construct has a boolean flag argument $keep, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function __construct(string $name, public LanguageInjection $delegate, public Statement $body, public bool $keep = true)

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

Missing class import via use statement (line '25', column '20').
Open

        return new \EmptyIterator();
Severity: Minor
Found in libs/compiler/src/Node/Node.php by phpmd

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

The method print has a boolean flag argument $multiline, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function print(mixed $data, bool $multiline = true): string

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

Remove error control operator '@' on line 178.
Open

    public function __unserialize(array $data): void
    {
        $this->algo = (string) ($data['algo'] ?? SourceFactory::DEFAULT_HASH_ALGO);
        $this->chunkSize = \max(1, (int) ($data['chunk'] ?? SourceFactory::DEFAULT_CHUNK_SIZE));
        $this->offset = \max(0, (int) ($data['seek'] ?? 0));
Severity: Minor
Found in libs/source/src/Stream.php by phpmd

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

The method __construct has a boolean flag argument $inline, which is a certain sign of a Single Responsibility Principle violation.
Open

    public function __construct(private bool $inline = true) {}

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

Missing class import via use statement (line '50', column '19').
Open

        throw new \BadMethodCallException(self::class . ' objects are immutable');
Severity: Minor
Found in libs/lexer/src/Token/Composite.php by phpmd

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

Remove error control operator '@' on line 100.
Open

    private function syncGetContents(): string
    {
        \error_clear_last();

        $result = @\file_get_contents($this->filename);
Severity: Minor
Found in libs/source/src/File.php by phpmd

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

The method __construct has a boolean flag argument $keep, which is a certain sign of a Single Responsibility Principle violation.
Open

        bool $keep = true,
Severity: Minor
Found in libs/parser/src/Grammar/Lexeme.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

Missing class import via use statement (line '29', column '23').
Open

            throw new \InvalidArgumentException('File include pathname must not be empty');

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

Missing class import via use statement (line '33', column '23').
Open

            throw new \InvalidArgumentException('File include must contain filename');

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

Remove error control operator '@' on line 170.
Open

    public function createFromPosition(
        ReadableInterface $source,
        int $line = PositionInterface::MIN_LINE,
        int $column = PositionInterface::MIN_COLUMN
    ): Position {
Severity: Minor
Found in libs/position/src/PositionFactory.php by phpmd

ErrorControlOperator

Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

Example

function foo($filePath) {
    $file = @fopen($filPath); // hides exceptions
    $key = @$array[$notExistingKey]; // assigns null to $key
}

Source http://phpmd.org/rules/cleancode.html#errorcontroloperator

Missing class import via use statement (line '60', column '20').
Open

        return new \ArrayIterator($this->children);
Severity: Minor
Found in libs/lexer/src/Token/Composite.php by phpmd

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

Severity
Category
Status
Source
Language