Completed
Push — master ( ad55a4...c98fe8 )
by Joachim
01:57
created

Callback::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 10
ccs 0
cts 8
cp 0
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 6
nc 2
nop 1
crap 6
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
    public function __construct(ServerRequestInterface $request)
20
    {
21
        $this->request = $request;
22
23
        $body = $this->request->getParsedBody();
24
        $body = is_array($body) ? $body : [];
25
        $this->body = $body;
26
27
        $this->init();
28
    }
29
}