Passed
Push — master ( 682802...46670a )
by Maximo
05:00 queued 10s
created

AppProvider   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A register() 0 8 1
1
<?php
2
3
namespace Gewaer\Providers;
4
5
use Phalcon\Di\ServiceProviderInterface;
6
use Phalcon\DiInterface;
7
use Gewaer\Models\Apps;
8
9
class AppProvider implements ServiceProviderInterface
10
{
11
    /**
12
     * @param DiInterface $container
13
     */
14 17
    public function register(DiInterface $container)
15
    {
16 17
        $config = $container->getShared('config');
17
18 17
        $container->setShared(
19 17
            'app',
20
            function () use ($config) {
21 3
                return Apps::findFirst($config->app->id);
22 17
            }
23
        );
24 17
    }
25
}
26