Passed
Push — master ( 13ce29...e039be )
by Adrian
02:19
created

AsSingleton   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getInstance() 0 6 2
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: Adi
5
 * Date: 4/28/2018
6
 * Time: 10:32 AM
7
 */
8
9
namespace Qpdb\QueryBuilder\Traits;
10
11
12
trait AsSingleton
13
{
14
15
	protected static $instance;
16
17
	/**
18
	 * @return $this
19
	 */
20
	public static function getInstance()
21
	{
22
		if ( is_null( self::$instance ) )
23
			self::$instance = new self();
24
25
		return self::$instance;
26
	}
27
28
}