seregazhuk/php-smsintel-api

View on GitHub

Showing 12 of 12 total issues

Avoid variables with short names like $to. Configured minimum length is 3.
Open

    public function send($to, $from, $message, $params = [ ])
Severity: Minor
Found in src/Api/Requests/JSONRequest.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

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

    public function checkCoupon($coupon, $markAsUsed = true, $phone = null)
Severity: Minor
Found in src/Api/Requests/XMLRequest.php by phpmd

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

Missing class import via use statement (line '53', column '26').
Open

        $this->dom = new \DOMDocument();
Severity: Minor
Found in src/Formatters/XMLFormatter.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

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

            new GuzzleHttpClient(new Client()),
Severity: Minor
Found in src/SmsIntel.php by phpcodesniffer

Closing brace must be on a line by itself
Open

    private function __clone(){}
Severity: Minor
Found in src/SmsIntel.php by phpcodesniffer

Closing parenthesis of a multi-line function call must be on a line by itself
Open

            ]);

Opening brace should be on a new line
Open

    private function __construct(){}
Severity: Minor
Found in src/SmsIntel.php by phpcodesniffer

Closing brace must be on a line by itself
Open

    private function __construct(){}
Severity: Minor
Found in src/SmsIntel.php by phpcodesniffer

Opening brace should be on a new line
Open

    private function __clone(){}
Severity: Minor
Found in src/SmsIntel.php by phpcodesniffer

Opening parenthesis of a multi-line function call must be the last content on the line
Open

        return $this->exec('reportNumber',

Expected 1 space after IF keyword; 0 found
Open

            if(in_array($action, $actions)) {

Multi-line function call not indented correctly; expected 8 spaces but found 12
Open

            ]);
Severity
Category
Status
Source
Language