Issues (3)

src/Util/NoValueMonad.php (1 issue)

1
<?php
2
3
namespace Smoren\PartialIntersection\Util;
4
5
/**
6
 * Based on IterTools PHP's IteratorFactory.
7
 * @see https://github.com/markrogoyski/itertools-php
8
 * @see https://github.com/markrogoyski/itertools-php/blob/main/src/Util/NoValueMonad.php
9
 */
10
class NoValueMonad
11
{
12
    private static ?self $instance = null;
13
14 238
    public static function getInstance(): self
15
    {
16 238
        if (self::$instance === null) {
17 1
            self::$instance = new self();
18
        }
19
20 238
        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...
21
    }
22
23 1
    private function __construct()
24
    {
25 1
    }
26
}
27