YetiForceCompany/YetiForceCRM

View on GitHub
app/Conditions/RecordFields/PicklistField.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid using static access to class '\App\RecordStatus' in method 'operatorRo'.
Open

        return ($fieldName = \App\RecordStatus::getFieldName($this->recordModel->getModule()->getName()))

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 '\App\RecordStatus' in method 'operatorRc'.
Open

        && \in_array($this->recordModel->get($fieldName), \App\RecordStatus::getStates($this->recordModel->getModule()->getName(), \App\RecordStatus::RECORD_STATE_CLOSED)));

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 '\App\RecordStatus' in method 'operatorRo'.
Open

        && \in_array($this->recordModel->get($fieldName), \App\RecordStatus::getStates($this->recordModel->getModule()->getName()), \App\RecordStatus::RECORD_STATE_OPEN);

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 '\App\RecordStatus' in method 'operatorRc'.
Open

        return !(($fieldName = \App\RecordStatus::getFieldName($this->recordModel->getModule()->getName()))

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

Argument 1 (moduleName) is false but \App\RecordStatus::getFieldName() takes string defined at /code/app/RecordStatus.php:406
Open

        return ($fieldName = \App\RecordStatus::getFieldName($this->recordModel->getModule()->getName()))

Argument 1 (moduleName) is false but \App\RecordStatus::getStates() takes string defined at /code/app/RecordStatus.php:113
Open

        && \in_array($this->recordModel->get($fieldName), \App\RecordStatus::getStates($this->recordModel->getModule()->getName()), \App\RecordStatus::RECORD_STATE_OPEN);

Argument 1 (moduleName) is false but \App\RecordStatus::getFieldName() takes string defined at /code/app/RecordStatus.php:406
Open

        return !(($fieldName = \App\RecordStatus::getFieldName($this->recordModel->getModule()->getName()))

Argument 1 (moduleName) is false but \App\RecordStatus::getStates() takes string defined at /code/app/RecordStatus.php:113
Open

        && \in_array($this->recordModel->get($fieldName), \App\RecordStatus::getStates($this->recordModel->getModule()->getName(), \App\RecordStatus::RECORD_STATE_CLOSED)));

Argument 3 (strict) is 1 but \in_array() takes bool
Open

        && \in_array($this->recordModel->get($fieldName), \App\RecordStatus::getStates($this->recordModel->getModule()->getName()), \App\RecordStatus::RECORD_STATE_OPEN);

Spaces must be used to indent lines; tabs are not allowed
Open

        && \in_array($this->recordModel->get($fieldName), \App\RecordStatus::getStates($this->recordModel->getModule()->getName()), \App\RecordStatus::RECORD_STATE_OPEN);

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

        return !(($fieldName = \App\RecordStatus::getFieldName($this->recordModel->getModule()->getName()))

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return bool

Spaces must be used to indent lines; tabs are not allowed
Open

    public function operatorRc()

Spaces must be used to indent lines; tabs are not allowed
Open

    /** {@inheritdoc} */

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    /**

Spaces must be used to indent lines; tabs are not allowed
Open

        return \in_array($this->getValue(), explode('##', $this->value));

Spaces must be used to indent lines; tabs are not allowed
Open

     * Record open operator.

Spaces must be used to indent lines; tabs are not allowed
Open

     * @return bool

Spaces must be used to indent lines; tabs are not allowed
Open

        return ($fieldName = \App\RecordStatus::getFieldName($this->recordModel->getModule()->getName()))

Spaces must be used to indent lines; tabs are not allowed
Open

        return !\in_array($this->getValue(), explode('##', $this->value));

Line exceeds 120 characters; contains 170 characters
Open

        && \in_array($this->recordModel->get($fieldName), \App\RecordStatus::getStates($this->recordModel->getModule()->getName()), \App\RecordStatus::RECORD_STATE_OPEN);

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

     * Record closed operator.

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

    public function operatorRo()

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Spaces must be used to indent lines; tabs are not allowed
Open

    }

Spaces must be used to indent lines; tabs are not allowed
Open

     *

Spaces must be used to indent lines; tabs are not allowed
Open

    {

Line exceeds 120 characters; contains 173 characters
Open

        && \in_array($this->recordModel->get($fieldName), \App\RecordStatus::getStates($this->recordModel->getModule()->getName(), \App\RecordStatus::RECORD_STATE_CLOSED)));

Spaces must be used to indent lines; tabs are not allowed
Open

    public function operatorE(): bool

Spaces must be used to indent lines; tabs are not allowed
Open

    public function operatorN(): bool

Spaces must be used to indent lines; tabs are not allowed
Open

     */

Spaces must be used to indent lines; tabs are not allowed
Open

        && \in_array($this->recordModel->get($fieldName), \App\RecordStatus::getStates($this->recordModel->getModule()->getName(), \App\RecordStatus::RECORD_STATE_CLOSED)));

There are no issues that match your filters.

Category
Status