Passed
Push — master ( d769b5...44239a )
by Mehmet
02:45
created

ContentsController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 18
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A factory() 0 6 1
1
<?php
2
declare(strict_types=1);
3
4
5
namespace SelamiApp\Controller\Contents;
6
7
use SelamiApp\Controller\Application;
8
use Selami\Interfaces\Application as App;
9
use Psr\Container\ContainerInterface;
10
use Psr\Http\Message\ServerRequestInterface;
11
use Symfony\Component\HttpFoundation\Session\Session;
12
13
14
abstract class ContentsController extends Application
15
{
16
17
    public function __construct(ServerRequestInterface $request, Session $session, ?array $args)
18
    {
19
        $this->session = $session;
20
        $this->request = $request;
21
        $this->args = $args;
22
    }
23
24
    public static function factory(ContainerInterface $container, ?array $args) : App
25
    {
26
        $session = $container->get(Session::class);
27
        $request = $container->get(ServerRequestInterface::class);
28
        return new static($request, $session, $args);
29
    }
30
31
}