Completed
Push — development ( e80362...5ad269 )
by Claudio
02:41
created

Singleton   A

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
 * @package App
8
 */
9
abstract class Singleton
10
{
11
    /**
12
     * Create and return a User instance.
13
     *
14
     * @return $this
15
     */
16
    public static function getInstance()
17
    {
18
        static $instance = null;
19
20
        if ($instance === null) {
21
            $instance = new static();
22
        }
23
24
        return $instance;
25
    }
26
}
27