Completed
Pull Request — master (#24)
by Pavlo
02:25
created

Entity::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 4
Bugs 0 Features 2
Metric Value
c 4
b 0
f 2
dl 0
loc 15
rs 9.4285
cc 1
eloc 9
nc 1
nop 3
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: onysko
5
 * Date: 27.05.2015
6
 * Time: 13:07
7
 */
8
namespace samsoncms\app\user\form\tab;
9
10
use samsoncms\app\user\field\FormGroup;
11
use samsoncms\form\field\Generic;
12
use samsonframework\core\RenderInterface;
13
use samsonframework\orm\QueryInterface;
14
use samsonframework\orm\Record;
15
16
/**
17
 * User SamsonCMS application form entity tab
18
 * @package samsoncms\app\user\form\tab
19
 */
20
class Entity extends \samsoncms\form\tab\Entity
21
{
22
    /** @var string Tab name or identifier */
23
    protected $name = 'Главная';
24
25
    /** @inheritdoc */
26
    public function __construct(RenderInterface $renderer, QueryInterface $query, Record $entity)
27
    {
28
        // Add fields
29
        $this->fields = array(
0 ignored issues
show
Documentation Bug introduced by
It seems like array(new \samsoncms\for...'Группа', true))) of type array<integer,object<sam...r\\field\\FormGroup>"}> is incompatible with the declared type array<integer,object<samsoncms\form\tab\Generic>> of property $fields.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
30
            new Generic('f_name', t('Имя', true), 0),
31
            new Generic('s_name', t('Фамилия', true), 0),
32
            new Generic('t_name', t('Отчество', true), 0),
33
            new Generic('email', t('Email', true), 0),
34
            new Generic('md5_password', t('Пароль', true), 0),
35
            new FormGroup('group_id', t('Группа', true))
36
        );
37
38
        // Call parent constructor to define all class fields
39
        parent::__construct($renderer, $query, $entity);
40
    }
41
}
42