Passed
Branch master (fc5382)
by Fabian
03:13
created

SingletonTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
dl 0
loc 13
ccs 0
cts 4
cp 0
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getInstance() 0 6 2
1
<?php
2
namespace LE_ACME2;
3
4
trait SingletonTrait {
5
6
    private static $_instance = NULL;
7
8
    /**
9
     * @return static
10
     */
11
    final public static function getInstance(): self {
12
13
        if( self::$_instance === NULL ) {
14
            self::$_instance = new self();
15
        }
16
        return self::$_instance;
17
    }
18
}