Passed
Push — master ( 23f099...2790c0 )
by Smoren
02:31
created

NoValueMonad::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 0
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 2
ccs 1
cts 1
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Smoren\PartialIntersection\Util;
4
5
class NoValueMonad
6
{
7
    private static ?self $instance = null;
8
9 121
    public static function getInstance(): self
10
    {
11 121
        if (self::$instance === null) {
12 1
            self::$instance = new self();
13
        }
14
15 121
        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 Smoren\PartialIntersection\Util\NoValueMonad. Consider adding an additional type-check to rule them out.
Loading history...
16
    }
17
18 1
    private function __construct()
19
    {
20 1
    }
21
}
22