src/Notifier/Service.php

Summary

Maintainability
A
0 mins
Test Coverage

Missing class import via use statement (line '66', column '17').
Open

            new Notifier_Engine_SmsIr(),
Severity: Minor
Found in src/Notifier/Service.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

Missing class import via use statement (line '65', column '17').
Open

            new Notifier_Engine_NoNotify(),
Severity: Minor
Found in src/Notifier/Service.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

Missing class import via use statement (line '67', column '17').
Open

            new Notifier_Engine_GamaSmsIr()
Severity: Minor
Found in src/Notifier/Service.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

Remove the unused function parameter "$data".
Open

    public static function sendNotification($data)
Severity: Major
Found in src/Notifier/Service.php by sonar-php

Unused parameters are misleading. Whatever the value passed to such parameters is, the behavior will be the same.

Noncompliant Code Example

function doSomething($a, $b) { // "$a" is unused
  return compute($b);
}

Compliant Solution

function doSomething($b) {
  return compute($b);
}

Exceptions

Functions in classes that override a class or implement interfaces are ignored.

class C extends B {

  function doSomething($a, $b) {     // no issue reported on $b
    compute($a);
  }

}

See

  • MISRA C++:2008, 0-1-11 - There shall be no unused parameters (named or unnamed) in nonvirtual functions.
  • MISRA C:2012, 2.7 - There should be no unused parameters in functions
  • CERT, MSC12-C. - Detect and remove code that has no effect or is never executed
  • CERT, MSC12-CPP. - Detect and remove code that has no effect

Avoid unused parameters such as '$data'.
Open

    public static function sendNotification($data)
Severity: Minor
Found in src/Notifier/Service.php by phpmd

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class Notifier_Service
Severity: Minor
Found in src/Notifier/Service.php by phpcodesniffer

The class Notifier_Service is not named in CamelCase.
Open

class Notifier_Service
{

    /**
     * Sends a notification.
Severity: Minor
Found in src/Notifier/Service.php by phpmd

CamelCaseClassName

Since: 0.2

It is considered best practice to use the CamelCase notation to name classes.

Example

class class_name {
}

Source

Whitespace found at end of line
Open

 *        
Severity: Minor
Found in src/Notifier/Service.php by phpcodesniffer

Class name "Notifier_Service" is not in camel caps format
Open

class Notifier_Service
Severity: Minor
Found in src/Notifier/Service.php by phpcodesniffer

Expected 1 newline at end of file; 0 found
Open

}
Severity: Minor
Found in src/Notifier/Service.php by phpcodesniffer

There are no issues that match your filters.

Category
Status