Passed
Push — master ( 12ed59...661264 )
by Julien
05:22
created

ServiceProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 7 1
1
<?php
2
/**
3
 * This file is part of the Zemit Framework.
4
 *
5
 * (c) Zemit Team <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE.txt
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Zemit\Provider\Request;
12
13
use Phalcon\Di\DiInterface;
14
use Zemit\Http\Request;
15
use Zemit\Provider\AbstractServiceProvider;
16
17
/**
18
 * Class ServiceProvider
19
 *
20
 * @author Julien Turbide <[email protected]>
21
 * @copyright Zemit Team <[email protected]>
22
 *
23
 * @since 1.0
24
 * @version 1.0
25
 *
26
 * @package Zemit\Provider\Request
27
 */
28
class ServiceProvider extends AbstractServiceProvider
29
{
30
    /**
31
     * The Service name.
32
     * @var string
33
     */
34
    protected $serviceName = 'request';
35
    
36
    /**
37
     * {@inheritdoc}
38
     *
39
     * @return void
40
     */
41 7
    public function register(DiInterface $di): void
42
    {
43 7
        $di->setShared($this->getName(), function() use ($di) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
44 7
            $request = new Request();
45 7
            $request->setDI($di);
46
            
47 7
            return $request;
48 7
        });
49
    }
50
}
51