jaroslavtyc/drd-plus-calculations

View on GitHub

Showing 45 of 45 total issues

Avoid using static access to class '\Granam\Float\Tools\ToFloat' in method 'round'.
Open

        return (int)round(ToFloat::toFloat($number));
Severity: Minor
Found in Calculations/SumAndRound.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 '\Granam\Float\Tools\ToFloat' in method 'flooredHalf'.
Open

        return self::floor(ToFloat::toFloat($number) / 2);
Severity: Minor
Found in Calculations/SumAndRound.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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_round_half'.
Open

        self::assertSame(2, SumAndRound::half($number));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_ceiled_half'.
Open

        self::assertSame(2, SumAndRound::ceiledHalf($number));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_third'.
Open

        self::assertSame(1, SumAndRound::third($number));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_floored_half'.
Open

        self::assertSame(2, SumAndRound::flooredHalf($number));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_round_a_number'.
Open

        self::assertSame(4, SumAndRound::round($shouldBeLower));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_ceil_a_number'.
Open

        self::assertSame(9, SumAndRound::ceil($integerAndBit));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_round_average_of_two_numbers'.
Open

        self::assertSame(2, SumAndRound::average($firstNumber, $secondNumber));

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 '\Granam\Float\Tools\ToFloat' in method 'average'.
Open

        return self::round((ToFloat::toFloat($firstNumber) + ToFloat::toFloat($secondNumber)) / 2);
Severity: Minor
Found in Calculations/SumAndRound.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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_ceiled_half'.
Open

        self::assertSame(3, SumAndRound::ceiledHalf($number));

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 '\Granam\Float\Tools\ToFloat' in method 'average'.
Open

        return self::round((ToFloat::toFloat($firstNumber) + ToFloat::toFloat($secondNumber)) / 2);
Severity: Minor
Found in Calculations/SumAndRound.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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_floor_a_number'.
Open

        self::assertSame(5, SumAndRound::floor($almostHigherInteger));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_round_average_of_two_numbers'.
Open

        self::assertSame(1, SumAndRound::average($firstNumber, $secondNumber));

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 '\Granam\Float\Tools\ToFloat' in method 'floor'.
Open

        return (int)floor(ToFloat::toFloat($number));
Severity: Minor
Found in Calculations/SumAndRound.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 method I_can_get_round_average_of_two_numbers is not named in camelCase.
Open

    public function I_can_get_round_average_of_two_numbers(): void
    {
        $firstNumber = 1.5123;
        $secondNumber = 2.5123;
        self::assertSame(2, SumAndRound::average($firstNumber, $secondNumber));

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method I_can_get_round_half is not named in camelCase.
Open

    public function I_can_get_round_half(): void
    {
        $number = 5;
        self::assertSame(3, SumAndRound::half($number));
        $number = 4.99;

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method I_can_get_floored_half is not named in camelCase.
Open

    public function I_can_get_floored_half(): void
    {
        $number = 5;
        self::assertSame(2, SumAndRound::flooredHalf($number));
        $number = 4.0001;

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method I_can_get_third is not named in camelCase.
Open

    public function I_can_get_third(): void
    {
        $number = 7.5;
        self::assertSame(3, SumAndRound::third($number));
        $number = 2.9999;

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method I_can_get_ceiled_third is not named in camelCase.
Open

    public function I_can_get_ceiled_third(): void
    {
        $number = 5;
        self::assertSame(2, SumAndRound::ceiledThird($number));
        $number = 2.9999;

CamelCaseMethodName

Since: 0.2

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

Example

class ClassName {
    public function get_name() {
    }
}

Source

Severity
Category
Status
Source
Language