Completed
Push — master ( b0867d...8ab030 )
by Alexander
24s queued 11s
created

CallableDefinition::resolve()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
namespace yii\di\definitions;
3
4
use Psr\Container\ContainerInterface;
5
use yii\di\Container;
6
use yii\di\contracts\Definition;
7
8
class CallableDefinition implements Definition
9
{
10
    private $method;
11
12
    public function __construct(callable $method)
13
    {
14
        $this->method = $method;
15
    }
16
17
    public function resolve(ContainerInterface $container, array $params = [])
18
    {
19
        $callback = $this->method;
20
        return $callback($container, $params);
21
    }
22
}
23