Passed
Push — trunk ( 8a2507...908a1a )
by Christian
12:39 queued 15s
created

SalesChannelContextAssembledEvent::getOrder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
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\Order\OrderEntity;
0 ignored issues
show
Bug introduced by
The type Shopware\Core\Checkout\Order\OrderEntity was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Shopware\Core\Framework\Context;
7
use Shopware\Core\Framework\Event\ShopwareSalesChannelEvent;
8
use Shopware\Core\Framework\Log\Package;
9
use Shopware\Core\System\SalesChannel\SalesChannelContext;
10
use Symfony\Contracts\EventDispatcher\Event;
11
12
/**
13
 * Allows the manipulation of the sales channel context after it was assembled from the order
14
 */
15
#[Package('checkout')]
16
class SalesChannelContextAssembledEvent extends Event implements ShopwareSalesChannelEvent
17
{
18
    /**
19
     * @internal
20
     */
21
    public function __construct(
22
        private readonly OrderEntity $order,
23
        private readonly SalesChannelContext $salesChannelContext,
24
    ) {
25
    }
26
27
    public function getOrder(): OrderEntity
28
    {
29
        return $this->order;
30
    }
31
32
    public function getContext(): Context
33
    {
34
        return $this->salesChannelContext->getContext();
35
    }
36
37
    public function getSalesChannelContext(): SalesChannelContext
38
    {
39
        return $this->salesChannelContext;
40
    }
41
}
42