ContactForm::init()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 5
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 11
rs 10
1
<?php
2
3
namespace ByTIC\GoogleRecaptcha\Tests\Fixtures\Forms;
4
5
use ByTIC\GoogleRecaptcha\Forms\FomHasRecaptchaTrait;
6
7
/**
8
 * Class ContactForm
9
 * @package ByTIC\GoogleRecaptcha\Fixtures\Forms
10
 */
11
class ContactForm extends \Nip\Form\AbstractForm
12
{
13
    use FomHasRecaptchaTrait;
14
15
    public function init()
16
    {
17
        parent::init();
18
19
        $this->setAttrib('id', 'contact-form');
20
21
        $this->addInput('name', 'name', true);
22
23
        $this->addButton('send', 'send');
0 ignored issues
show
Bug introduced by
'send' of type string is incompatible with the type boolean expected by parameter $label of Nip\Form\AbstractForm::addButton(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

23
        $this->addButton('send', /** @scrutinizer ignore-type */ 'send');
Loading history...
24
25
        $this->initRecaptcha();
26
    }
27
}
28