whiteCube/lingua

View on GitHub

Showing 36 of 36 total issues

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

            throw new \Exception('Call to undefined "'. $prefix . '" Lingua method');
Severity: Minor
Found in src/Lingua/Service.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

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

        throw new \Exception('Call to undefined Lingua method "' . $method . '"');
Severity: Minor
Found in src/Lingua/Service.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 using static access to class 'WhiteCube\Lingua\LanguagesRepository' in method 'check'.
Open

        if(LanguagesRepository::find('name', self::prepare($format))) return true;
Severity: Minor
Found in src/Lingua/NameConverter.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 using static access to class 'WhiteCube\Lingua\LanguagesRepository' in method 'parse'.
Open

        $this->repository = LanguagesRepository::find('native', $this->original);
Severity: Minor
Found in src/Lingua/NativeConverter.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 parameters such as '$arguments'.
Open

    protected function convert($method, $arguments = [])
Severity: Minor
Found in src/Lingua/Service.php by phpmd

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 using static access to class 'WhiteCube\Lingua\LanguagesRepository' in method 'findInRepository'.
Open

                ?? LanguagesRepository::find('iso-639-2b', $this->original['iso']);
Severity: Minor
Found in src/Lingua/ComponentConverter.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 using static access to class 'WhiteCube\Lingua\LanguagesRepository' in method 'parse'.
Open

        $this->repository = LanguagesRepository::find('iso-639-3', $parsed);
Severity: Minor
Found in src/Lingua/Iso_639_3Converter.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 using static access to class 'WhiteCube\Lingua\LanguagesRepository' in method 'check'.
Open

        if(LanguagesRepository::find('native', self::prepare($format))) return true;
Severity: Minor
Found in src/Lingua/NativeConverter.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 using static access to class 'WhiteCube\Lingua\LanguagesRepository' in method 'parse'.
Open

        $this->repository = LanguagesRepository::find('iso-639-2t', $this->original);
Severity: Minor
Found in src/Lingua/Iso_639_2tConverter.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 '$key'.
Open

        foreach (self::$converters as $key => $converter) {
Severity: Minor
Found in src/Lingua/Service.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

Avoid using static access to class 'WhiteCube\Lingua\LanguagesRepository' in method 'findInRepository'.
Open

                ?? LanguagesRepository::find('iso-639-2t', $this->original['iso'])
Severity: Minor
Found in src/Lingua/ComponentConverter.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 using static access to class 'WhiteCube\Lingua\LanguagesRepository' in method 'findInRepository'.
Open

            return LanguagesRepository::find('iso-639-3', $this->original['iso'])
Severity: Minor
Found in src/Lingua/ComponentConverter.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 using static access to class 'WhiteCube\Lingua\LanguagesRepository' in method 'parse'.
Open

        $this->repository = LanguagesRepository::find('iso-639-1', $this->original);
Severity: Minor
Found in src/Lingua/Iso_639_1Converter.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 using static access to class 'WhiteCube\Lingua\LanguagesRepository' in method 'findInRepository'.
Open

        return LanguagesRepository::find('iso-639-1', $this->original['iso']);
Severity: Minor
Found in src/Lingua/ComponentConverter.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 using static access to class 'WhiteCube\Lingua\LanguagesRepository' in method 'parse'.
Open

        $this->repository = LanguagesRepository::find('iso-639-2b', $this->original);
Severity: Minor
Found in src/Lingua/Iso_639_2bConverter.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 using static access to class 'WhiteCube\Lingua\LanguagesRepository' in method 'parse'.
Open

        $this->repository = LanguagesRepository::find('name', $this->original);
Severity: Minor
Found in src/Lingua/NameConverter.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

Severity
Category
Status
Source
Language