Singleton   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getInstance() 0 10 2
1
<?php
2
3
namespace App;
4
5
/**
6
 * Class Singleton.
7
 */
8
abstract class Singleton
9
{
10
    /**
11
     * Create and return a User instance.
12
     *
13
     * @return $this
14
     */
15
    public static function getInstance()
16
    {
17
        static $instance = null;
18
19
        if ($instance === null) {
20
            $instance = new static();
21
        }
22
23
        return $instance;
24
    }
25
}
26