VSVverkeerskunde/gvq-api

View on GitHub
src/Common/CsvResponse.php

Summary

Maintainability
A
0 mins
Test Coverage

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

            throw new \LogicException('The content cannot be set on a StreamedResponse instance.');
Severity: Minor
Found in src/Common/CsvResponse.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

Avoid unused private methods such as 'convertNullToString'.
Open

    private function convertNullToString($value)
    {
        if ($value === null) {
            return '';
        }
Severity: Minor
Found in src/Common/CsvResponse.php by phpmd

UnusedPrivateMethod

Since: 0.2

Unused Private Method detects when a private method is declared but is unused.

Example

class Something
{
    private function foo() {} // unused
}

Source https://phpmd.org/rules/unusedcode.html#unusedprivatemethod

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

    private function writeSeparatorHintLine($f)
Severity: Minor
Found in src/Common/CsvResponse.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

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

    private function writeCells($f, $cells)
Severity: Minor
Found in src/Common/CsvResponse.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

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

        $f = fopen('php://output', 'r+');
Severity: Minor
Found in src/Common/CsvResponse.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

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

    private function writeBOM($f)
Severity: Minor
Found in src/Common/CsvResponse.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

TRUE, FALSE and NULL must be lowercase; expected "null" but found "NULL"
Open

        parent::__construct(NULL, 200);
Severity: Minor
Found in src/Common/CsvResponse.php by phpcodesniffer

Closing parenthesis of a multi-line function call must be on a line by itself
Open

                'application/csv; charset=UTF-16LE');
Severity: Minor
Found in src/Common/CsvResponse.php by phpcodesniffer

Multi-line function call not indented correctly; expected 12 spaces but found 16
Open

                'application/csv; charset=UTF-16LE');
Severity: Minor
Found in src/Common/CsvResponse.php by phpcodesniffer

Opening parenthesis of a multi-line function call must be the last content on the line
Open

            $this->headers->set('Content-Type',
Severity: Minor
Found in src/Common/CsvResponse.php by phpcodesniffer

There are no issues that match your filters.

Category
Status