Completed
Branch BUG/11475/decode-site-title-fo... (bbd86e)
by
unknown
13:39 queued 25s
created

RecaptchaFactory::create()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 1
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace EventEspresso\caffeinated\modules\recaptcha_invisible;
4
5
use EventEspresso\core\domain\services\factories\FactoryInterface;
6
use EventEspresso\core\exceptions\InvalidDataTypeException;
7
use EventEspresso\core\exceptions\InvalidInterfaceException;
8
use EventEspresso\core\services\loaders\LoaderFactory;
9
use InvalidArgumentException;
10
11
defined('EVENT_ESPRESSO_VERSION') || exit;
12
13
14
15
/**
16
 * Class RecaptchaFactory
17
 * Factory class for generating InvisibleRecaptcha or RecaptchaAdminSettings objects
18
 *
19
 * @package EventEspresso\caffeinated\modules\recaptcha_invisible
20
 * @author  Brent Christensen
21
 * @since   $VID:$
22
 */
23
class RecaptchaFactory implements FactoryInterface
24
{
25
26
    /**
27
     * @param array $arguments
28
     * @return InvisibleRecaptcha
29
     * @throws InvalidDataTypeException
30
     * @throws InvalidInterfaceException
31
     * @throws InvalidArgumentException
32
     */
33
    public static function create($arguments = array())
34
    {
35
        return LoaderFactory::getLoader()->getShared(
36
            'EventEspresso\caffeinated\modules\recaptcha_invisible\InvisibleRecaptcha',
37
            $arguments
38
        );
39
    }
40
41
42
43
    /**
44
     * @param array $arguments
45
     * @return RecaptchaAdminSettings
46
     * @throws InvalidDataTypeException
47
     * @throws InvalidInterfaceException
48
     * @throws InvalidArgumentException
49
     */
50
    public static function getAdminModule($arguments = array())
51
    {
52
        return LoaderFactory::getLoader()->getShared(
53
            'EventEspresso\caffeinated\modules\recaptcha_invisible\RecaptchaAdminSettings',
54
            $arguments
55
        );
56
    }
57
}
58