CartValidator::lineItemCanBeAdded()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 2
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace QuickCheckout;
4
5
class CartValidator
6
{
7
8
    /**
9
     * Check is line item can be added to cart.
10
     *
11
     * @param Cart $cart
12
     * @param LineItem $lineItem
13
     *
14
     * @return bool
15
     */
16 3
    public function lineItemCanBeAdded(Cart $cart, LineItem $lineItem): bool
0 ignored issues
show
Unused Code introduced by
The parameter $lineItem is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

16
    public function lineItemCanBeAdded(Cart $cart, /** @scrutinizer ignore-unused */ LineItem $lineItem): bool

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $cart is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

16
    public function lineItemCanBeAdded(/** @scrutinizer ignore-unused */ Cart $cart, LineItem $lineItem): bool

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Bug introduced by
The type QuickCheckout\LineItem was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
17
    {
18 3
        return true;
19
    }
20
}
21