bat()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
* @author SignpostMarv
4
*/
5
declare(strict_types=1);
6
7
namespace SignpostMarv\DaftMagicPropertyAnalysis\Tests;
8
9
function bat() : DaftMagicPropertyAnalysis\Fixtures\ucwordsPrefixedTypeInterface
10
{
11
    return
12
        1 === random_int(0, 1)
13
            ? new DaftMagicPropertyAnalysis\Fixtures\ucwordsPrefixedImplementation()
14
            : new DaftMagicPropertyAnalysis\Fixtures\ucwordsPrefixedIdentical();
15
}
16
17
$foo = bat();
18
19
$shouldBeTrue = '' === $foo->fooBar;
20
21
if ($foo instanceof DaftMagicPropertyAnalysis\Fixtures\ucwordsPrefixedImplementation) {
22
    $foo->fooBar = 'baz';
23
}
24
25
$shouldBeTrue = 'baz' === $foo->fooBar;
26