JavascriptForm::initialize()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
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 Cms\Form;
8
9
use Application\Form\Form;
10
use Phalcon\Forms\Element\TextArea;
11
use Phalcon\Forms\Element\Hidden;
12
13
class JavascriptForm extends Form
14
{
15
16
    public function initialize()
17
    {
18
        $style = 'height:300px;font-size:13px';
19
        $this->add((new TextArea('head', array('style' => $style)))->setLabel(htmlentities('<head>')));
0 ignored issues
show
Documentation introduced by
(new \Phalcon\Forms\Elem...htmlentities('<head>')) 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...
20
        $this->add((new TextArea('body', array('style' => $style)))->setLabel(htmlentities('<body>')));
0 ignored issues
show
Documentation introduced by
(new \Phalcon\Forms\Elem...htmlentities('<body>')) 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...
21
22
    }
23
24
}