Passed
Push — master ( 00604e...06d537 )
by Darío
02:22
created

Form::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 1
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * DronePHP (http://www.dronephp.com)
4
 *
5
 * @link      http://github.com/Pleets/DronePHP
6
 * @copyright Copyright (c) 2016-2018 Pleets. (http://www.pleets.org)
7
 * @license   http://www.dronephp.com/license
8
 * @author    Darío Rivera <[email protected]>
9
 */
10
11
namespace Drone\Dom\Element;
12
13
/**
14
 * Form class
15
 *
16
 * Represents a html Form element
17
 */
18
class Form extends AbstractElement
19
{
20
    /**
21
     * The node name of the element
22
     *
23
     * @var string
24
     */
25
    const NODE_NAME = 'FORM';
26
27
    /**
28
     * Tells if the element has a end tag
29
     *
30
     * @var boolean
31
     */
32
    const HAS_END_TAG = true;
33
34
    /**
35
     * Fills the form with all passed values
36
     *
37
     * @param array $values
38
     */
39
    public function fill(Array $values)
40
    {
41
        foreach ($values as $label => $value)
42
        {
43
            $this->setAttribute($label, "value", $value);
0 ignored issues
show
Unused Code introduced by
The call to Drone\Dom\Element\AbstractElement::setAttribute() has too many arguments starting with 'value'. ( Ignorable by Annotation )

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

43
            $this->/** @scrutinizer ignore-call */ 
44
                   setAttribute($label, "value", $value);

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
44
        }
45
    }
46
}