Movie   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

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 1
    public function init(): void
10
    {
11
        // Set the method for the display form to GET
12 1
        $this->setMethod('get');
13
14
        // Add the comment element
15 1
        $this->addElement('text', 'id', [
16 1
            '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 1
        $this->addElement('submit', 'submit', [
26 1
            'ignore' => true,
27 1
            'label' => _tr('Add movie'),
28
        ]);
29 1
    }
30
}
31