Completed
Push — master ( 7a1429...168b0d )
by Chris
02:39
created

HttpService   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
c 1
b 0
f 0
lcom 0
cbo 3
dl 0
loc 12
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 9 1
1
<?php
2
namespace Darya\Service\Provider;
3
4
use Darya\Http\Request;
5
use Darya\Http\Session\Php as PhpSession;
6
use Darya\Service\Contracts\Container;
7
use Darya\Service\Contracts\Provider;
8
9
/**
10
 * A service provider that provides HTTP request and response objects.
11
 * 
12
 * @author Chris Andrew <[email protected]>
13
 */
14
class HttpService implements Provider
15
{
16
    public function register(Container $container)
17
    {
18
		$container->register(array(
19
            'Darya\Http\Request' => function ($container) {
20
                return Request::createFromGlobals($container->resolve('Darya\Http\Session'));
21
            },
22
            'Darya\Http\Session' => new PhpSession
23
        ));
24
    }
25
}
26