Passed
Pull Request — master (#412)
by Wilmer
36:35 queued 23:53
created

AnyValue   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
c 0
b 0
f 0
dl 0
loc 11
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getInstance() 0 7 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Db\Tests\Support;
6
7
final class AnyValue extends CompareValue
8
{
9
    private static self|null $instance = null;
10
11
    public static function getInstance(): self
12
    {
13
        if (self::$instance === null) {
14
            self::$instance = new self();
15
        }
16
17
        return self::$instance;
0 ignored issues
show
Bug Best Practice introduced by
The expression return self::instance could return the type null which is incompatible with the type-hinted return Yiisoft\Db\Tests\Support\AnyValue. Consider adding an additional type-check to rule them out.
Loading history...
18
    }
19
}
20