HoneypotSpamProtector   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 33
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getFormField() 0 4 1
A setFieldMapping() 0 4 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