ContainerFactory::createLaravelContainer()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

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