Passed
Push — master ( ff8ca7...001f87 )
by Julien
05:55 queued 01:01
created

ServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 6
c 1
b 0
f 0
dl 0
loc 12
ccs 5
cts 5
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 8 1
1
<?php
2
3
/**
4
 * This file is part of the Zemit Framework.
5
 *
6
 * (c) Zemit Team <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE.txt
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Zemit\Provider\Request;
13
14
use Phalcon\Di\DiInterface;
15
use Zemit\Http\Request;
16
use Zemit\Provider\AbstractServiceProvider;
17
18
class ServiceProvider extends AbstractServiceProvider
19
{
20
    protected string $serviceName = 'request';
21
    
22 23
    public function register(DiInterface $di): void
23
    {
24 23
        $di->setShared($this->getName(), function () use ($di) {
25
26 3
            $request = new Request();
27 3
            $request->setDI($di);
28
            
29 3
            return $request;
30 23
        });
31
    }
32
}
33