|
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
|
|
|
|