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

CartItemCollection::getItems()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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