LanguageForm   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 36
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A initialize() 0 31 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\Check;
11
use Phalcon\Forms\Element\Text;
12
13
class LanguageForm extends Form
14
{
15
16
    public function initialize()
17
    {
18
        $this->add((new Text('iso', array(
0 ignored issues
show
Documentation introduced by
(new \Phalcon\Forms\Elem...rue)))->setLabel('ISO') 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...
19
            'data-description' => 'Language code according to standard ISO. For example: en',
20
            'required' => true
21
        )))->setLabel('ISO'));
22
23
        $this->add((new Text('locale', array(
0 ignored issues
show
Documentation introduced by
(new \Phalcon\Forms\Elem...)))->setLabel('Locale') 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...
24
            'data-description' => 'Designation locale language standard ISO. For example: en_EN',
25
            'required' => true
26
        )))->setLabel('Locale'));
27
28
        $this->add((new Text('name', array(
0 ignored issues
show
Documentation introduced by
(new \Phalcon\Forms\Elem...)->setLabel('Language') 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...
29
            'data-description' => 'For example: English',
30
            'required' => true
31
        )))->setLabel('Language'));
32
33
        $this->add((new Text('short_name', array(
0 ignored issues
show
Documentation introduced by
(new \Phalcon\Forms\Elem...tLabel('Shorting name') 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...
34
            'data-description' => 'For example: Eng',
35
            'required' => true
36
        )))->setLabel('Shorting name'));
37
38
        $this->add((new Text('url', array(
0 ignored issues
show
Documentation introduced by
(new \Phalcon\Forms\Elem...>setLabel('URL-prefix') 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...
39
            'data-description' => 'The URL-prefix string of the page. For example: en. For the "main language" is not considered to generate a URL',
40
            'required' => true
41
        )))->setLabel('URL-prefix'));
42
43
        $this->add((new Text('sortorder'))->setLabel('Sort order'));
0 ignored issues
show
Documentation introduced by
(new \Phalcon\Forms\Elem...>setLabel('Sort order') 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...
44
45
        $this->add((new Check('primary'))->setLabel('Is primary'));
0 ignored issues
show
Documentation introduced by
(new \Phalcon\Forms\Elem...>setLabel('Is primary') 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...
46
    }
47
48
}