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

Callback   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 23
ccs 7
cts 7
cp 1
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 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