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

Entity   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 5
Bugs 1 Features 2
Metric Value
wmc 1
c 5
b 1
f 2
lcom 0
cbo 3
dl 0
loc 22
rs 10

1 Method

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