Completed
Push — master ( c98fe8...bf7ad8 )
by Joachim
05:52
created

Callback::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 7
cts 7
cp 1
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 6
nc 2
nop 1
crap 2
1
<?php
2
3
namespace Loevgaard\AltaPay\Callback;
4
5
use Psr\Http\Message\ServerRequestInterface;
6
7
abstract class Callback implements CallbackInterface
8
{
9
    /**
10
     * @var ServerRequestInterface
11
     */
12
    protected $request;
13
14
    /**
15
     * @var array
16
     */
17
    protected $body;
18
19 18
    public function __construct(ServerRequestInterface $request)
20
    {
21 18
        $this->request = $request;
22
23 18
        $body = $this->request->getParsedBody();
24 18
        $body = is_array($body) ? $body : [];
25 18
        $this->body = $body;
26
27 18
        $this->init();
28 15
    }
29
}
30