src/ast/expr/TernaryExpr.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using static access to class '\QuackCompiler\Intl\Localization' in method 'getType'.
Open

            throw new TypeError(Localization::message('TYP250', [$truthy, $falsy]));
Severity: Minor
Found in src/ast/expr/TernaryExpr.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 '\QuackCompiler\Intl\Localization' in method 'getType'.
Open

            throw new TypeError(Localization::message('TYP240', [$condition]));
Severity: Minor
Found in src/ast/expr/TernaryExpr.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

The parameter $parent_scope is not named in camelCase.
Open

    public function injectScope($parent_scope)
    {
        $this->scope = $parent_scope;
        $this->condition->injectScope($parent_scope);
        $this->then->injectScope($parent_scope);
Severity: Minor
Found in src/ast/expr/TernaryExpr.php by phpmd

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The variable $parent_scope is not named in camelCase.
Open

    public function injectScope($parent_scope)
    {
        $this->scope = $parent_scope;
        $this->condition->injectScope($parent_scope);
        $this->then->injectScope($parent_scope);
Severity: Minor
Found in src/ast/expr/TernaryExpr.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $parent_scope is not named in camelCase.
Open

    public function injectScope($parent_scope)
    {
        $this->scope = $parent_scope;
        $this->condition->injectScope($parent_scope);
        $this->then->injectScope($parent_scope);
Severity: Minor
Found in src/ast/expr/TernaryExpr.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $parent_scope is not named in camelCase.
Open

    public function injectScope($parent_scope)
    {
        $this->scope = $parent_scope;
        $this->condition->injectScope($parent_scope);
        $this->then->injectScope($parent_scope);
Severity: Minor
Found in src/ast/expr/TernaryExpr.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $parent_scope is not named in camelCase.
Open

    public function injectScope($parent_scope)
    {
        $this->scope = $parent_scope;
        $this->condition->injectScope($parent_scope);
        $this->then->injectScope($parent_scope);
Severity: Minor
Found in src/ast/expr/TernaryExpr.php by phpmd

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

There are no issues that match your filters.

Category
Status