Completed
Pull Request — master (#98)
by Alejandro
06:29
created

AbstractRestAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 2
1
<?php
2
namespace Shlinkio\Shlink\Rest\Action;
3
4
use Fig\Http\Message\RequestMethodInterface;
5
use Fig\Http\Message\StatusCodeInterface;
6
use Interop\Http\ServerMiddleware\MiddlewareInterface;
7
use Psr\Log\LoggerInterface;
8
use Psr\Log\NullLogger;
9
10
abstract class AbstractRestAction implements MiddlewareInterface, RequestMethodInterface, StatusCodeInterface
11
{
12
    /**
13
     * @var LoggerInterface
14
     */
15
    protected $logger;
16
17 34
    public function __construct(LoggerInterface $logger = null)
18
    {
19 34
        $this->logger = $logger ?: new NullLogger();
20 34
    }
21
}
22