Passed
Push — master ( 51a972...dacf9c )
by Christian
10:27 queued 10s
created

CartSavedEvent::getSalesChannelContext()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
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\System\SalesChannel\SalesChannelContext;
7
use Symfony\Contracts\EventDispatcher\Event;
8
9
/**
10
 * @deprecated tag:v6.4.0 - Will implement Shopware\Core\Framework\Event\ShopwareSalesChannelEvent
11
 */
12
class CartSavedEvent extends Event /*implements ShopwareSalesChannelEvent*/
13
{
14
    /**
15
     * @var SalesChannelContext
16
     */
17
    protected $context;
18
19
    /**
20
     * @var Cart
21
     */
22
    protected $cart;
23
24
    public function __construct(SalesChannelContext $context, Cart $cart)
25
    {
26
        $this->context = $context;
27
        $this->cart = $cart;
28
    }
29
30
    /**
31
     * @deprecated tag:v6.4.0 - Will return Shopware\Core\Framework\Context instead
32
     */
33
    public function getContext(): SalesChannelContext
34
    {
35
        return $this->context;
36
    }
37
38
    public function getSalesChannelContext(): SalesChannelContext
39
    {
40
        return $this->context;
41
    }
42
43
    public function getCart(): Cart
44
    {
45
        return $this->cart;
46
    }
47
}
48