ClosureDefinition   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 23
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getClosure() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of the Container package.
5
 *
6
 * Copyright (c) Miloš Đurić <[email protected]>
7
 *
8
 * For full copyright and license information, please refer to the LICENSE file,
9
 * located at the package root folder.
10
 */
11
12
namespace Laganica\Di\Definition;
13
14
use Closure;
15
16
/**
17
 * Class ClosureDefinition
18
 *
19
 * @package Laganica\Di\Definition
20
 */
21
class ClosureDefinition implements DefinitionInterface
22
{
23
    /**
24
     * @var Closure
25
     */
26
    private $closure;
27
28
    /**
29
     * @param Closure $closure
30
     */
31 2
    public function __construct(Closure $closure)
32
    {
33 2
        $this->closure = $closure;
34 2
    }
35
36
    /**
37
     * @return Closure
38
     */
39 2
    public function getClosure(): Closure
40
    {
41 2
        return $this->closure;
42
    }
43
}
44