src/Shop/Precondition.php
Avoid using static access to class 'User_Precondition' in method 'canViewOrder'. Open
Open
if (User_Precondition::isOwner($request)) {
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class Shop_Precondition
- Exclude checks
The class Shop_Precondition is not named in CamelCase. Open
Open
class Shop_Precondition
{
/**
* Returns true if user (sending request) can view information of the order.
- 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 1 blank line at end of file; 3 found Open
Open
}
- Exclude checks
Class name "Shop_Precondition" is not in camel caps format Open
Open
class Shop_Precondition
- Exclude checks