UtilsBase   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 22
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A instance() 0 10 2
A __clone() 0 4 1
1
<?php
2
3
namespace JimmyOak\Utility;
4
5
abstract class UtilsBase
6
{
7
    protected function __construct()
8
    {
9
    }
10
11
    public static function instance()
12
    {
13
        static $instance = null;
14
15
        if ($instance === null) {
16
            $instance = new static();
17
        }
18
19
        return $instance;
20
    }
21
22
    public function __clone()
23
    {
24
        throw new \Exception('Singleton class, use instance() method');
25
    }
26
}
27