Completed
Branch master (91c650)
by Ryuichi
05:32 queued 02:45
created

ContainerProvider::valueDynamicProvider()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
namespace WebStream\Container\Test\Providers;
3
4
/**
5
 * ContainerProvider
6
 * @author Ryuichi TANAKA.
7
 * @since 2016/08/20
8
 * @version 0.7
9
 */
10
trait ContainerProvider
11
{
12
    public function valueLazyProvider()
13
    {
14
        $func = function() {
15
            return "test";
16
        };
17
18
        return [
19
            ["test", "test"],
20
            [123, 123],
21
            [true, true],
22
            [$func, "test"]
23
        ];
24
    }
25
26
    public function valueDynamicProvider()
27
    {
28
        $func = function() {
0 ignored issues
show
Unused Code introduced by
$func is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
29
            return "test";
30
        };
31
32
        return [
33
            ["test", "test"],
34
            [123, 123],
35
            [true, true]
36
        ];
37
    }
38
}
39