Completed
Branch master (48aedc)
by thomas
03:23 queued 02:08
created

PaymentRequestInfo::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Bip70\Client;
6
7
use Bip70\Protobuf\Proto\PaymentRequest;
8
use X509\CertificationPath\PathValidation\PathValidationResult;
9
10
class PaymentRequestInfo
11
{
12
    /**
13
     * @var PaymentRequest
14
     */
15
    private $request;
16
17
    /**
18
     * @var null|PathValidationResult
19
     */
20
    private $validationResult;
21
22
    /**
23
     * PaymentRequestInfo constructor.
24
     * @param PaymentRequest $request
25
     * @param PathValidationResult|null $pathValidation
26
     */
27 2
    public function __construct(PaymentRequest $request, PathValidationResult $pathValidation = null)
28
    {
29 2
        $this->request = $request;
30 2
        $this->validationResult = $pathValidation;
31 2
    }
32
33
    /**
34
     * @return PaymentRequest
35
     */
36
    public function request(): PaymentRequest
37
    {
38
        return $this->request;
39
    }
40
41
    /**
42
     * @return null|PathValidationResult
43
     */
44 2
    public function pathValidation()
45
    {
46 2
        return $this->validationResult;
47
    }
48
}
49