Connection   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 12
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getInstance() 0 7 2
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