src/Shop/Order/Manager.php
The method apply has a boolean flag argument $save, which is a certain sign of a Single Responsibility Principle violation. Open
Open
public function apply ($order, $action, $save = false);
- Read upRead up
- Exclude checks
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
Open
interface Shop_Order_Manager
- Exclude checks
The class Shop_Order_Manager is not named in CamelCase. Open
Open
interface Shop_Order_Manager
{
/**
* Creates an order filter
- Read upRead up
- Exclude checks
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
Open
public function apply ($order, $action, $save = false);
- Exclude checks
Expected "function abc(...);"; found "function abc (...);" Open
Open
public function transitions ($order);
- Exclude checks
Expected "function abc(...);"; found "function abc (...);" Open
Open
public function apply ($order, $action, $save = false);
- Exclude checks
Expected "function abc(...);"; found "function abc (...);" Open
Open
public function createOrderFilter ($request);
- Exclude checks
Expected 0 spaces before opening parenthesis; 1 found Open
Open
public function createOrderFilter ($request);
- Exclude checks
Expected 0 spaces before opening parenthesis; 1 found Open
Open
public function transitions ($order);
- Exclude checks
Whitespace found at end of line Open
Open
* Each implementation could define its own states and events for orders.
- Exclude checks
Whitespace found at end of line Open
Open
*
- Exclude checks
Expected 1 newline at end of file; 0 found Open
Open
}
- Exclude checks
Whitespace found at end of line Open
Open
*
- Exclude checks
Interface name "Shop_Order_Manager" is not in camel caps format Open
Open
interface Shop_Order_Manager
- Exclude checks
Whitespace found at end of line Open
Open
*
- Exclude checks
Whitespace found at end of line Open
Open
*
- Exclude checks