PluginFactory::create()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 0
dl 0
loc 8
ccs 0
cts 5
cp 0
crap 6
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Mamaduka\BpNotifications;
4
5
/**
6
 * Class PluginFactory
7
 */
8
final class PluginFactory {
9
10
	/**
11
	 * Create and return an instance of the plugin.
12
	 *
13
	 * This always returns a shared instance.
14
	 */
15
	public static function create() {
16
		static $plugin = null;
17
18
		if ( null === $plugin ) {
19
			$plugin = new Plugin();
20
		}
21
22
		return $plugin;
23
	}
24
}