chippyash/Simple-Accounts

View on GitHub
src/Chippyash/SAccounts/Chart.php

Summary

Maintainability
A
0 mins
Test Coverage

The class Chart has a coupling between objects value of 15. Consider to reduce the number of dependencies under 13.
Open

class Chart implements Identifiable
{
    use Identifying;

    /**@+
Severity: Minor
Found in src/Chippyash/SAccounts/Chart.php by phpmd

CouplingBetweenObjects

Since: 1.1.0

A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

Example

class Foo {
    /**
     * @var \foo\bar\X
     */
    private $x = null;

    /**
     * @var \foo\bar\Y
     */
    private $y = null;

    /**
     * @var \foo\bar\Z
     */
    private $z = null;

    public function setFoo(\Foo $foo) {}
    public function setBar(\Bar $bar) {}
    public function setBaz(\Baz $baz) {}

    /**
     * @return \SplObjectStorage
     * @throws \OutOfRangeException
     * @throws \InvalidArgumentException
     * @throws \ErrorException
     */
    public function process(\Iterator $it) {}

    // ...
}

Source https://phpmd.org/rules/design.html#couplingbetweenobjects

Expected 1 space before opening brace; found 0
Open

            ->accnt(function () use ($nId){

Only one argument is allowed per line in a multi-line function call
Open

                    (($account->getType()->getValue() & AccountType::DR) == AccountType::DR), false)

Space after opening parenthesis of function call prohibited
Open

            ->account( function ($accnt) {

Closing parenthesis of a multi-line function call must be on a line by itself
Open

                    (($account->getType()->getValue() & AccountType::DR) == AccountType::DR), false)

Expected 0 spaces before closing bracket; newline found
Open

                Match::on(Option::create(

Multi-line function call not indented correctly; expected 16 spaces but found 20
Open

                    (($account->getType()->getValue() & AccountType::DR) == AccountType::DR), false)

There are no issues that match your filters.

Category
Status