Passed
Branch master (168fd2)
by Dariusz
06:34
created

CartItemCollection   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 19
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A addItem() 0 4 1
A getItems() 0 4 1
A length() 0 4 1
1
<?php declare(strict_types=1);
2
3
/*
4
 * This file is part of the Plane\Shop package.
5
 *
6
 * (c) Dariusz Korsak <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Plane\Shop;
13
14
class CartItemCollection
15
{
16
    private $items = [];
17
18 2
    public function addItem(CartItemInterface $cartItem)
19
    {
20 2
        $this->items[] = $cartItem;
21 2
    }
22
23 2
    public function getItems()
24
    {
25 2
        return $this->items;
26
    }
27
    
28 1
    public function length()
29
    {
30 1
        return count($this->items);
31
    }
32
}
33