1 | <?php |
||
17 | class FormSpamProtectionExtension extends Extension |
||
18 | { |
||
19 | use Configurable; |
||
20 | |||
21 | /** |
||
22 | * @config |
||
23 | * |
||
24 | * The default spam protector class name to use. Class should implement the |
||
25 | * {@link SpamProtector} interface. |
||
26 | * |
||
27 | * @var string $spam_protector |
||
28 | */ |
||
29 | private static $default_spam_protector; |
||
|
|||
30 | |||
31 | /** |
||
32 | * @config |
||
33 | * |
||
34 | * The {@link enableSpamProtection} method will define which of the form |
||
35 | * values correlates to this form mapped fields list. Totally custom forms |
||
36 | * and subclassed SpamProtector instances are define their own mapping |
||
37 | * |
||
38 | * @var array $mappable_fields |
||
39 | */ |
||
40 | private static $mappable_fields = array( |
||
41 | 'id', |
||
42 | 'title', |
||
43 | 'body', |
||
44 | 'contextUrl', |
||
45 | 'contextTitle', |
||
46 | 'authorName', |
||
47 | 'authorMail', |
||
48 | 'authorUrl', |
||
49 | 'authorIp', |
||
50 | 'authorId' |
||
51 | ); |
||
52 | |||
53 | /** |
||
54 | * @config |
||
55 | * |
||
56 | * The field name to use for the {@link SpamProtector} {@link FormField} |
||
57 | * |
||
58 | * @var string $spam_protector |
||
59 | */ |
||
60 | private static $field_name = "Captcha"; |
||
61 | |||
62 | /** |
||
63 | * Instantiate a SpamProtector instance |
||
64 | * |
||
65 | * @param array $options Configuration options |
||
66 | * @return SpamProtector|null |
||
67 | */ |
||
68 | public static function get_protector($options = null) |
||
83 | |||
84 | /** |
||
85 | * Activates the spam protection module. |
||
86 | * |
||
87 | * @param array $options |
||
88 | * @return Object |
||
89 | */ |
||
90 | public function enableSpamProtection($options = array()) |
||
133 | } |
||
134 |
This check marks private properties in classes that are never used. Those properties can be removed.