HoneypotSpamProtector::setFieldMapping()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 1
nc 1
nop 1
1
<?php namespace StudioBonito\SilverStripe\SpamProtection\Honeypot\SpamProtector;
2
3
use StudioBonito\SilverStripe\SpamProtection\Honeypot\FormField\HoneypotField;
4
5
class HoneypotSpamProtector implements \SpamProtector
6
{
7
    /**
8
     * Return the {@link FormField} associated with this protector.
9
     *
10
     * Most spam methods will simply return a piece of HTML to be injected at
11
     * the end of the form. If a spam method needs to inject more than one
12
     * form field (i.e a hidden field and a text field) then return a
13
     * {@link FieldGroup} from this method to include both.
14
     *
15
     * @codeCoverageIgnore
16
     *
17
     * @param string $name
18
     * @param string $title
19
     * @param mixed  $value
20
     *
21
     * @return \FormField The resulting field
22
     */
23
    public function getFormField($name = null, $title = null, $value = null)
24
    {
25
        return HoneypotField::create($name, $title, $value);
26
    }
27
28
    /**
29
     * Not used.
30
     *
31
     * @codeCoverageIgnore
32
     */
33
    public function setFieldMapping($fieldMapping)
34
    {
35
        //
36
    }
37
}
38