ContainerFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A createLaravelContainer() 0 10 1
1
<?php
2
/*
3
 * Copyright (c) 2015 Juan José Torroglosa Ramón
4
 *
5
 * This file is part of the Cliphar package.
6
 *
7
 * For the full copyright and license information, please view
8
 * the LICENSE file that was distributed with this source code.
9
 */
10
11
namespace Cliphar\Container;
12
13
use Cliphar\Container\Laravel\LaravelBinderAdapter;
14
use Cliphar\Container\Laravel\LaravelContainerAdapter;
15
use Interop\Container\ContainerInterface;
16
use Illuminate\Container\Container as LaravelContainer;
17
18
/**
19
 * Class ContainerFactory
20
 */
21
class ContainerFactory
22
{
23
    /**
24
     * @return ContainerInterface
25
     */
26
    public function createLaravelContainer()
27
    {
28
        $laravelContainer = new LaravelContainer();
29
        $interopContainer = new LaravelContainerAdapter($laravelContainer);
30
        $binder = new LaravelBinderAdapter($laravelContainer);
31
        $binder->bindToInstance('Interop\Container\ContainerInterface', $interopContainer);
32
        $binder->bindToInstance('Cliphar\Binder', $binder);
33
34
        return $interopContainer;
35
    }
36
}