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

SalesChannelContextTokenChangeEvent::getContext()   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\System\SalesChannel\Event;
4
5
use Shopware\Core\Framework\Context;
6
use Shopware\Core\Framework\Event\ShopwareSalesChannelEvent;
7
use Shopware\Core\System\SalesChannel\SalesChannelContext;
8
use Symfony\Contracts\EventDispatcher\Event;
9
10
class SalesChannelContextTokenChangeEvent extends Event implements ShopwareSalesChannelEvent
11
{
12
    /**
13
     * @var SalesChannelContext
14
     */
15
    protected $salesChannelContext;
16
17
    /**
18
     * @var string
19
     */
20
    protected $previousToken;
21
22
    /**
23
     * @var string
24
     */
25
    protected $currentToken;
26
27
    public function __construct(SalesChannelContext $salesChannelContext, string $previousToken, string $currentToken)
28
    {
29
        $this->salesChannelContext = $salesChannelContext;
30
        $this->previousToken = $previousToken;
31
        $this->currentToken = $currentToken;
32
    }
33
34
    public function getSalesChannelContext(): SalesChannelContext
35
    {
36
        return $this->salesChannelContext;
37
    }
38
39
    public function getContext(): Context
40
    {
41
        return $this->salesChannelContext->getContext();
42
    }
43
44
    public function getPreviousToken(): string
45
    {
46
        return $this->previousToken;
47
    }
48
49
    public function getCurrentToken(): string
50
    {
51
        return $this->currentToken;
52
    }
53
}
54