Completed
Branch BUG-10666-add-check-for-iconv (fb844e)
by
unknown
110:35 queued 98:22
created

CommandFactory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 43
rs 10
wmc 2
lcom 1
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getNew() 0 4 1
1
<?php
2
3
namespace EventEspresso\core\services\commands;
4
5
use EventEspresso\core\exceptions\InvalidDataTypeException;
6
use EventEspresso\core\exceptions\InvalidInterfaceException;
7
use EventEspresso\core\services\loaders\LoaderInterface;
8
use InvalidArgumentException;
9
10
defined('EVENT_ESPRESSO_VERSION') || exit;
11
12
13
14
/**
15
 * Class CommandFactory
16
 * Uses a LoaderInterface class to build and return Command
17
 *
18
 * @package       Event Espresso
19
 * @author        Brent Christensen
20
 * @since         $VID:$
21
 */
22
class CommandFactory implements CommandFactoryInterface
23
{
24
25
26
27
    /**
28
     * @var LoaderInterface $loader
29
     */
30
    private $loader;
31
32
33
34
    /**
35
     * CommandFactory constructor
36
     *
37
     * @param LoaderInterface $loader
38
     * @throws InvalidDataTypeException
39
     * @throws InvalidInterfaceException
40
     * @throws InvalidArgumentException
41
     */
42
    public function __construct(LoaderInterface $loader = null)
43
    {
44
       $this->loader = $loader;
45
    }
46
47
48
49
    /**
50
     * @param string $command_fqcn
51
     * @param array  $arguments
52
     * @return mixed
53
     * @throws InvalidArgumentException
54
     * @throws InvalidDataTypeException
55
     * @throws InvalidInterfaceException
56
     */
57
    public function getNew($command_fqcn, $arguments = array())
58
    {
59
        return $this->loader->getNew($command_fqcn, $arguments);
60
    }
61
62
63
64
}
65
// End of file CommandFactory.php
66
// Location: EventEspresso\core\services\commands/CommandFactory.php