RobotsForm::initialize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
    /**
3
     * @copyright Copyright (c) 2011 - 2014 Oleksandr Torosh (http://wezoom.net)
4
     * @author Oleksandr Torosh <[email protected]>
5
     */
6
7
namespace Seo\Form;
8
9
use Application\Form\Form;
10
use Phalcon\Forms\Element\TextArea;
11
12
class RobotsForm extends Form
13
{
14
15
    public function initialize()
16
    {
17
        $this->add((new TextArea('robots', ['style' => 'height:600px;']))->setLabel('Contents'));
0 ignored issues
show
Documentation introduced by
(new \Phalcon\Forms\Elem...)->setLabel('Contents') is of type null, but the function expects a object<Phalcon\Forms\ElementInterface>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
18
    }
19
20
}