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

CartItemCollection::getItem()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 8
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 8
loc 8
ccs 0
cts 7
cp 0
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 1
crap 6
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