JavascriptForm   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A initialize() 0 7 1
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
}