Passed
Branch master (e3e371)
by Nate
03:50
created

AbstractMiddleware::isResponseSuccessful()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 16
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 16
ccs 0
cts 14
cp 0
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 8
nc 2
nop 1
crap 6
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://github.com/flipbox/relay/blob/master/LICENSE
6
 * @link       https://github.com/flipbox/relay
7
 */
8
9
namespace Flipbox\Relay\Middleware;
10
11
use Flipbox\Skeleton\Logger\AutoLoggerTrait;
12
use Flipbox\Skeleton\Object\AbstractObject;
13
use Psr\Http\Message\RequestInterface;
14
use Psr\Http\Message\ResponseInterface;
15
use Relay\MiddlewareInterface;
16
17
/**
18
 * @author Flipbox Factory <[email protected]>
19
 * @since 2.0.0
20
 */
21
abstract class AbstractMiddleware extends AbstractObject implements MiddlewareInterface
22
{
23
    use AutoLoggerTrait;
24
25
    /**
26
     * @param RequestInterface $request
27
     * @param ResponseInterface $response
28
     * @param callable|null $next
29
     * @return ResponseInterface|void
30
     */
31
    public function __invoke(
32
        RequestInterface $request,
33
        ResponseInterface $response,
34
        callable $next = null
35
    ) {
36
        // Log
37
        $this->debug(
38
            sprintf(
39
                "Begin '%s' Middleware",
40
                get_class($this)
41
            )
42
        );
43
    }
44
}
45