Passed
Push — master ( afdc6b...e39cc4 )
by Adrien
03:24
created

Movie   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
eloc 11
c 0
b 0
f 0
dl 0
loc 21
ccs 0
cts 14
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 19 1
1
<?php
2
3
namespace mQueue\Form;
4
5
use Zend_Form;
6
7
class Movie extends Zend_Form
8
{
9
    public function init(): void
10
    {
11
        // Set the method for the display form to GET
12
        $this->setMethod('get');
13
14
        // Add the comment element
15
        $this->addElement('text', 'id', [
16
            'label' => _tr('IMDb url or id:'),
17
            'required' => true,
18
            'autofocus' => true,
19
            'validators' => [
20
                ['validator' => 'Regex', 'options' => ["/(\d{7,})/"]],
21
            ],
22
        ]);
23
24
        // Add the submit button
25
        $this->addElement('submit', 'submit', [
26
            'ignore' => true,
27
            'label' => _tr('Add movie'),
28
        ]);
29
    }
30
}
31