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

Callback   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 23
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 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
    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
}