Passed
Push — trunk ( 5b7d3d...2a754e )
by Christian
12:07 queued 12s
created

CartLoadedEvent   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 20
rs 10
c 1
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getCart() 0 3 1
A getSalesChannelContext() 0 3 1
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\Log\Package;
7
use Shopware\Core\System\SalesChannel\SalesChannelContext;
8
use Symfony\Contracts\EventDispatcher\Event;
9
10
#[Package('checkout')]
11
class CartLoadedEvent extends Event
12
{
13
    /**
14
     * @internal
15
     */
16
    public function __construct(
17
        protected readonly Cart $cart,
18
        protected readonly SalesChannelContext $salesChannelContext,
19
    ) {
20
    }
21
22
    public function getCart(): Cart
23
    {
24
        return $this->cart;
25
    }
26
27
    public function getSalesChannelContext(): SalesChannelContext
28
    {
29
        return $this->salesChannelContext;
30
    }
31
}
32