Passed
Push — master ( 07d4ad...0f913e )
by Christian
11:35 queued 11s
created

AfterLineItemAddedEvent::getLineItems()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 1
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Core\Checkout\Cart\Event;
4
5
use Shopware\Core\Checkout\Cart\Cart;
6
use Shopware\Core\Framework\Context;
7
use Shopware\Core\Framework\Event\ShopwareSalesChannelEvent;
8
use Shopware\Core\System\SalesChannel\SalesChannelContext;
9
10
class AfterLineItemAddedEvent implements ShopwareSalesChannelEvent
11
{
12
    /**
13
     * @var array
14
     */
15
    protected $lineItems;
16
17
    /**
18
     * @var Cart
19
     */
20
    protected $cart;
21
22
    /**
23
     * @var SalesChannelContext
24
     */
25
    protected $salesChannelContext;
26
27
    public function __construct(array $lineItems, Cart $cart, SalesChannelContext $salesChannelContext)
28
    {
29
        $this->lineItems = $lineItems;
30
        $this->cart = $cart;
31
        $this->salesChannelContext = $salesChannelContext;
32
    }
33
34
    public function getLineItems(): array
35
    {
36
        return $this->lineItems;
37
    }
38
39
    public function getCart(): Cart
40
    {
41
        return $this->cart;
42
    }
43
44
    public function getContext(): Context
45
    {
46
        return $this->salesChannelContext->getContext();
47
    }
48
49
    public function getSalesChannelContext(): SalesChannelContext
50
    {
51
        return $this->salesChannelContext;
52
    }
53
}
54