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

AsSingleton::getInstance()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
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
}