Completed
Push — master ( 467d47...6f2bb4 )
by Anton
14s
created

Instance   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 5
cts 5
cp 1
c 0
b 0
f 0
rs 10
wmc 2
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getInstance() 0 8 2
1
<?php
2
/**
3
 * Bluz Framework Component
4
 *
5
 * @copyright Bluz PHP Team
6
 * @link      https://github.com/bluzphp/framework
7
 */
8
9
declare(strict_types=1);
10
11
namespace Bluz\Common;
12
13
/**
14
 * Instance
15
 *
16
 * @package  Bluz\Common
17
 * @author   Anton Shevchuk
18
 */
19
trait Instance
20
{
21
    /**
22
     * Get instance
23
     * @return static
24
     */
25 56
    public static function getInstance()
26
    {
27 56
        static $instance;
28 56
        if (null === $instance) {
29 3
            $instance = new static();
30
        }
31 56
        return $instance;
32
    }
33
}
34