src/Shop/Order/Manager.php

Summary

Maintainability
A
0 mins
Test Coverage

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

    public function apply ($order, $action, $save = false);
Severity: Minor
Found in src/Shop/Order/Manager.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

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

interface Shop_Order_Manager
Severity: Minor
Found in src/Shop/Order/Manager.php by phpcodesniffer

The class Shop_Order_Manager is not named in CamelCase.
Open

interface Shop_Order_Manager
{

    /**
     * Creates an order filter
Severity: Minor
Found in src/Shop/Order/Manager.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

Expected 0 spaces before opening parenthesis; 1 found
Open

    public function apply ($order, $action, $save = false);
Severity: Minor
Found in src/Shop/Order/Manager.php by phpcodesniffer

Expected "function abc(...);"; found "function abc (...);"
Open

    public function transitions ($order);
Severity: Minor
Found in src/Shop/Order/Manager.php by phpcodesniffer

Expected "function abc(...);"; found "function abc (...);"
Open

    public function apply ($order, $action, $save = false);
Severity: Minor
Found in src/Shop/Order/Manager.php by phpcodesniffer

Expected "function abc(...);"; found "function abc (...);"
Open

    public function createOrderFilter ($request);
Severity: Minor
Found in src/Shop/Order/Manager.php by phpcodesniffer

Expected 0 spaces before opening parenthesis; 1 found
Open

    public function createOrderFilter ($request);
Severity: Minor
Found in src/Shop/Order/Manager.php by phpcodesniffer

Expected 0 spaces before opening parenthesis; 1 found
Open

    public function transitions ($order);
Severity: Minor
Found in src/Shop/Order/Manager.php by phpcodesniffer

Whitespace found at end of line
Open

 * Each implementation could define its own states and events for orders. 
Severity: Minor
Found in src/Shop/Order/Manager.php by phpcodesniffer

Whitespace found at end of line
Open

     * 
Severity: Minor
Found in src/Shop/Order/Manager.php by phpcodesniffer

Expected 1 newline at end of file; 0 found
Open

}
Severity: Minor
Found in src/Shop/Order/Manager.php by phpcodesniffer

Whitespace found at end of line
Open

 * 
Severity: Minor
Found in src/Shop/Order/Manager.php by phpcodesniffer

Interface name "Shop_Order_Manager" is not in camel caps format
Open

interface Shop_Order_Manager
Severity: Minor
Found in src/Shop/Order/Manager.php by phpcodesniffer

Whitespace found at end of line
Open

     * 
Severity: Minor
Found in src/Shop/Order/Manager.php by phpcodesniffer

Whitespace found at end of line
Open

 * 
Severity: Minor
Found in src/Shop/Order/Manager.php by phpcodesniffer

There are no issues that match your filters.

Category
Status