PluginFactory   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 8 2
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
}