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

ContentsController::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 3
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
}