Connection::getInstance()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4285
nc 2
cc 2
eloc 4
nop 0
1
<?php
2
3
namespace Creational\Singleton;
4
5
class Connection
6
{
7
    private static $instance;
8
9
    public static function getInstance()
10
    {
11
        if (self::$instance === null) {
12
            self::$instance = new static();
13
        }
14
        return self::$instance;
15
    }
16
}
17