SAREhub/PHP_Client

View on GitHub
src/SAREhub/Client/Amqp/AmqpConnectionOptions.php

Summary

Maintainability
A
2 hrs
Test Coverage

AmqpConnectionOptions has 25 functions (exceeds 20 allowed). Consider refactoring.
Open

class AmqpConnectionOptions
{
    const DEFAULT_CONNECTION_TIMEOUT = 3;
    const DEFAULT_HEARTBEAT = 30;

Severity: Minor
Found in src/SAREhub/Client/Amqp/AmqpConnectionOptions.php - About 2 hrs to fix

    The method withKeepalive has a boolean flag argument $keepalive, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function withKeepalive(bool $keepalive = true): AmqpConnectionOptions

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    The method withSsl has a boolean flag argument $enabled, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function withSsl(bool $enabled = true): AmqpConnectionOptions

    BooleanArgumentFlag

    Since: 1.4.0

    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

    Example

    class Foo {
        public function bar($flag = true) {
        }
    }

    Source https://phpmd.org/rules/cleancode.html#booleanargumentflag

    There must be one blank line after the namespace declaration
    Open

    namespace SAREhub\Client\Amqp;

    Expected 1 newline at end of file; 0 found
    Open

    }

    There are no issues that match your filters.

    Category
    Status