Completed
Push — master ( a9b85a...cc544e )
by Dmitry
04:19
created

Application::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Basis;
4
5
use League\Container\Container;
6
use League\Container\ReflectionContainer;
7
8
class Application extends Container
9
{
10 7
    public function __construct($root)
11
    {
12 7
        parent::__construct();
13
14 7
        $fs = new Filesystem($this, $root);
15
16 7
        $this->share(Application::class, $this);
17 7
        $this->share(Container::class, $this);
18 7
        $this->share(Framework::class, new Framework($this));
0 ignored issues
show
Unused Code introduced by
The call to Framework::__construct() has too many arguments starting with $this.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
19 7
        $this->share(Filesystem::class, $fs);
20 7
        $this->share(Http::class, new Http($this));
21
22 7
        $this->addServiceProvider(Providers\Tarantool::class);
23 7
        $this->addServiceProvider(Providers\Etcd::class);
24
25 7
        foreach($fs->listClasses('Providers') as $provider) {
26 7
            $this->addServiceProvider($provider);
27
        }
28
29 7
        $this->delegate(new ReflectionContainer());
30 7
    }
31
32 2
    public function dispatch($command, $params = [])
33
    {
34 2
        return $this->get(Runner::class)->dispatch($command, $params);
35
    }
36
}