Context   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getRequest() 0 3 1
A __construct() 0 4 1
A getMessage() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cakasim\Payone\Sdk\Notification\Context;
6
7
use Cakasim\Payone\Sdk\Notification\Message\MessageInterface;
8
use Psr\Http\Message\ServerRequestInterface;
9
10
/**
11
 * Implementation of the ContextInterface.
12
 *
13
 * @author Fabian Böttcher <[email protected]>
14
 * @since 0.1.0
15
 */
16
class Context implements ContextInterface
17
{
18
    /**
19
     * @var ServerRequestInterface Stores the inbound HTTP request.
20
     */
21
    protected $request;
22
23
    /**
24
     * @var MessageInterface Stores the notification message.
25
     */
26
    protected $message;
27
28
    /**
29
     * Constructs a notification context.
30
     *
31
     * @param ServerRequestInterface $request The inbound HTTP request.
32
     * @param MessageInterface $message The notification message.
33
     */
34
    public function __construct(ServerRequestInterface $request, MessageInterface $message)
35
    {
36
        $this->request = $request;
37
        $this->message = $message;
38
    }
39
40
    /**
41
     * @inheritDoc
42
     */
43
    public function getRequest(): ServerRequestInterface
44
    {
45
        return $this->request;
46
    }
47
48
    /**
49
     * @inheritDoc
50
     */
51
    public function getMessage(): MessageInterface
52
    {
53
        return $this->message;
54
    }
55
}
56