AbstractCartEvent::getItem()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

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
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace jamesdb\Cart\Event;
4
5
use jamesdb\Cart\Cart;
6
use jamesdb\Cart\CartItem;
7
use League\Event\AbstractEvent;
8
9
abstract class AbstractCartEvent extends AbstractEvent
10
{
11
    /*
12
     * @var \jamesdb\Cart\Cart
13
     */
14
    protected $cart;
15
16
    /**
17
     * The added item.
18
     *
19
     * @var \jamesdb\Cart\CartItem
20
     */
21
    protected $item;
22
23
    /**
24
     * Constructor.
25
     *
26
     * @param jamesdb\Cart\Cart      $cart
27
     * @param jamesdb\Cart\CartItem  $item
28
     */
29 39
    public function __construct(Cart $cart, CartItem $item)
30
    {
31 39
        $this->cart = $cart;
32 39
        $this->item = $item;
33 39
    }
34
35
    /**
36
     * Get the cart.
37
     *
38
     * @return \jamesdb\Cart\Cart
39
     */
40 9
    public function getCart()
41
    {
42 9
        return $this->cart;
43
    }
44
45
    /**
46
     * Get the item.
47
     *
48
     * @return \jamesdb\Cart\CartItem
49
     */
50 9
    public function getItem()
51
    {
52 9
        return $this->item;
53
    }
54
}
55