1 | <?php |
||
10 | class FormSpamProtectionExtension extends Extension |
||
|
|||
11 | { |
||
12 | /** |
||
13 | * @config |
||
14 | * |
||
15 | * The default spam protector class name to use. Class should implement the |
||
16 | * {@link SpamProtector} interface. |
||
17 | * |
||
18 | * @var string $spam_protector |
||
19 | */ |
||
20 | private static $default_spam_protector; |
||
21 | |||
22 | /** |
||
23 | * @config |
||
24 | * |
||
25 | * The {@link enableSpamProtection} method will define which of the form |
||
26 | * values correlates to this form mapped fields list. Totally custom forms |
||
27 | * and subclassed SpamProtector instances are define their own mapping |
||
28 | * |
||
29 | * @var array $mappable_fields |
||
30 | */ |
||
31 | private static $mappable_fields = array( |
||
32 | 'id', |
||
33 | 'title', |
||
34 | 'body', |
||
35 | 'contextUrl', |
||
36 | 'contextTitle', |
||
37 | 'authorName', |
||
38 | 'authorMail', |
||
39 | 'authorUrl', |
||
40 | 'authorIp', |
||
41 | 'authorId' |
||
42 | ); |
||
43 | |||
44 | /** |
||
45 | * @config |
||
46 | * |
||
47 | * The field name to use for the {@link SpamProtector} {@link FormField} |
||
48 | * |
||
49 | * @var string $spam_protector |
||
50 | */ |
||
51 | private static $field_name = "Captcha"; |
||
52 | |||
53 | /** |
||
54 | * Instantiate a SpamProtector instance |
||
55 | * |
||
56 | * @param array $options Configuration options |
||
57 | * @return SpamProtector |
||
58 | */ |
||
59 | public static function get_protector($options = null) |
||
74 | |||
75 | /** |
||
76 | * Activates the spam protection module. |
||
77 | * |
||
78 | * @param array $options |
||
79 | */ |
||
80 | public function enableSpamProtection($options = array()) |
||
123 | } |
||
124 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.