rogervila/cart

View on GitHub

Showing 17 of 17 total issues

Missing class import via use statement (line '18', column '23').
Open

            throw new \Exception('$this->currency should be instance of Money\Currency, "' . get_class($this->currency) . '" given');
Severity: Minor
Found in src/Helpers/Calculator.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '73', column '23').
Open

            throw new \Exception('Item->quantity() expects an integer');
Severity: Minor
Found in src/Item.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '88', column '23').
Open

            throw new \Exception('There is more than one item with the id "' . $id . '" on the cart with id "' . $this->id . '"');
Severity: Minor
Found in src/Transformers/CartTransformer.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '127', column '23').
Open

            throw new \Exception('Value passed to Cart->add() is not an array nor an Item. Value passed: ' . json_encode($arrayOrItem));
Severity: Minor
Found in src/Cart.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '156', column '23').
Open

            throw new \Exception("An item without ID can't be added to the cart. The item: " . json_encode($item));
Severity: Minor
Found in src/Cart.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

Missing class import via use statement (line '165', column '23').
Open

            throw new \Exception('Item->setFields() expects an array. Argument given: ' . json_encode($fields));
Severity: Minor
Found in src/Item.php by phpmd

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

has accesses the super-global variable $_SESSION.
Open

    public function has($key)
    {
        return isset($_SESSION[$this->name][$key]);
    }
Severity: Minor
Found in src/Session.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

put accesses the super-global variable $_SESSION.
Open

    public function put($key, $value)
    {
        $_SESSION[$this->name][$key] = serialize($value);

        return $_SESSION[$this->name][$key];
Severity: Minor
Found in src/Session.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

get accesses the super-global variable $_SESSION.
Open

    public function get($key)
    {
        if ($this->has($key)) {
            return unserialize($_SESSION[$this->name][$key]);
        }
Severity: Minor
Found in src/Session.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

put accesses the super-global variable $_SESSION.
Open

    public function put($key, $value)
    {
        $_SESSION[$this->name][$key] = serialize($value);

        return $_SESSION[$this->name][$key];
Severity: Minor
Found in src/Session.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

forget accesses the super-global variable $_SESSION.
Open

    public function forget($key)
    {
        if ($this->has($key)) {
            unset($_SESSION[$this->name][$key]);

Severity: Minor
Found in src/Session.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

flush accesses the super-global variable $_SESSION.
Open

    public function flush()
    {
        $_SESSION[$this->name] = [];

        return true;
Severity: Minor
Found in src/Session.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

TODO found
Open

TODO
Severity: Minor
Found in README.md by fixme

TODO found
Open

TODO
Severity: Minor
Found in README.md by fixme

TODO found
Open

    // TODO
Severity: Minor
Found in src/Condition.php by fixme

TODO found
Open

TODO
Severity: Minor
Found in README.md by fixme

TODO found
Open

    // TODO
Severity: Minor
Found in src/Fee.php by fixme
Severity
Category
Status
Source
Language