src/Shop/Precondition.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using static access to class 'User_Precondition' in method 'canViewOrder'.
Open

        if (User_Precondition::isOwner($request)) {
Severity: Minor
Found in src/Shop/Precondition.php by phpmd

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

class Shop_Precondition
Severity: Minor
Found in src/Shop/Precondition.php by phpcodesniffer

The class Shop_Precondition is not named in CamelCase.
Open

class Shop_Precondition
{

    /**
     * Returns true if user (sending request) can view information of the order.
Severity: Minor
Found in src/Shop/Precondition.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 1 blank line at end of file; 3 found
Open

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

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

class Shop_Precondition
Severity: Minor
Found in src/Shop/Precondition.php by phpcodesniffer

There are no issues that match your filters.

Category
Status