Completed
Branch FET-10853-loader-factory (2e61ab)
by
unknown
131:17 queued 118:20
created

LoaderFactory::getLoader()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 4
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 7
rs 9.4285
1
<?php
2
3
namespace EventEspresso\core\services\loaders;
4
5
use EventEspresso\core\exceptions\InvalidDataTypeException;
6
use EventEspresso\core\exceptions\InvalidInterfaceException;
7
use InvalidArgumentException;
8
9
defined('EVENT_ESPRESSO_VERSION') || exit;
10
11
12
/**
13
 * Class LoaderFactory
14
 *
15
 * @package       Event Espresso
16
 * @author        Brent Christensen
17
 * @since         4.9.44
18
 */
19
class LoaderFactory
20
{
21
22
    /**
23
     * @var LoaderInterface $loader ;
24
     */
25
    private static $loader;
0 ignored issues
show
Unused Code introduced by
The property $loader is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
26
27
28
29
    /**
30
     * @return LoaderInterface
31
     * @throws InvalidArgumentException
32
     * @throws InvalidInterfaceException
33
     * @throws InvalidDataTypeException
34
     */
35
    public static function getLoader()
36
    {
37
        if (! LoaderFactory::$loader instanceof LoaderInterface) {
38
            LoaderFactory::$loader = new Loader();
39
        }
40
        return LoaderFactory::$loader;
41
    }
42
43
44
}
45