PersistenceResult::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
/**
4
 * Copyright (c) Phauthentic (https://github.com/Phauthentic)
5
 *
6
 * Licensed under The MIT License
7
 * For full copyright and license information, please see the LICENSE.txt
8
 * Redistributions of files must retain the above copyright notice.
9
 *
10
 * @copyright     Copyright (c) Phauthentic (https://github.com/Phauthentic)
11
 * @link          https://github.com/Phauthentic
12
 * @license       https://opensource.org/licenses/mit-license.php MIT License
13
 */
14
15
declare(strict_types=1);
16
17
namespace Phauthentic\Authentication;
18
19
use Psr\Http\Message\ResponseInterface;
20
use Psr\Http\Message\ServerRequestInterface;
21
22
/**
23
 * Persistence Result Interface
24
 */
25
class PersistenceResult implements PersistenceResultInterface
26
{
27
    /**
28
     * Response
29
     * @var \Psr\Http\Message\ResponseInterface
30
     */
31
    protected ResponseInterface $response;
32
33
    /**
34
     * Request
35
     *
36
     * @var \Psr\Http\Message\ServerRequestInterface
37
     */
38
    protected ServerRequestInterface $request;
39
40
    /**
41
     * Constructor
42
     *
43 20
     * @param \Psr\Http\Message\ServerRequestInterface $request
44
     * @param \Psr\Http\Message\ResponseInterface $response
45 20
     */
46 20
    public function __construct(ServerRequestInterface $request, ResponseInterface $response)
47 20
    {
48
        $this->request = $request;
49
        $this->response = $response;
50
    }
51
52
    /**
53
     * Returns response.
54 16
     *
55
     * @return \Psr\Http\Message\ResponseInterface
56 16
     */
57
    public function getResponse(): ResponseInterface
58
    {
59
        return $this->response;
60
    }
61
62
    /**
63
     * Returns request.
64 4
     *
65
     * @return \Psr\Http\Message\ServerRequestInterface
66 4
     */
67
    public function getRequest(): ServerRequestInterface
68
    {
69
        return $this->request;
70
    }
71
}
72