Passed
Pull Request — master (#3157)
by
unknown
04:26
created

ContextStamp   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getContext() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of the API Platform project.
5
 *
6
 * (c) Kévin Dunglas <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace ApiPlatform\Core\Bridge\Symfony\Messenger;
15
16
use Symfony\Component\Messenger\Stamp\StampInterface;
17
18
/**
19
 * An envelope stamp with context which related to a message.
20
 *
21
 * @experimental
22
 *
23
 * @author Sergii Pavlenko <[email protected]>
24
 */
25
final class ContextStamp implements StampInterface
26
{
27
    /**
28
     * @var array
29
     */
30
    private $context;
31
32
    public function __construct($context = [])
33
    {
34
        $this->context = $context;
35
    }
36
37
    /**
38
     * Get the context related to a message.
39
     */
40
    public function getContext(): array
41
    {
42
        return $this->context;
43
    }
44
45
}
46