Entity::__construct()   A
last analyzed

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),
0 ignored issues
show
Deprecated Code introduced by
The function t() has been deprecated with message: Should be used as $this->system->getContainer()->geti18n()->translate()|plural()

This function has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead.

Loading history...
31
            new Generic('s_name', t('Фамилия', true), 0),
0 ignored issues
show
Deprecated Code introduced by
The function t() has been deprecated with message: Should be used as $this->system->getContainer()->geti18n()->translate()|plural()

This function has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead.

Loading history...
32
            new Generic('t_name', t('Отчество', true), 0),
0 ignored issues
show
Deprecated Code introduced by
The function t() has been deprecated with message: Should be used as $this->system->getContainer()->geti18n()->translate()|plural()

This function has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead.

Loading history...
33
            new Generic('email', t('Email', true), 0),
0 ignored issues
show
Deprecated Code introduced by
The function t() has been deprecated with message: Should be used as $this->system->getContainer()->geti18n()->translate()|plural()

This function has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead.

Loading history...
34
            new Generic('hash_password', t('Пароль', true), 15),
0 ignored issues
show
Deprecated Code introduced by
The function t() has been deprecated with message: Should be used as $this->system->getContainer()->geti18n()->translate()|plural()

This function has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead.

Loading history...
35
            new FormGroup('group_id', t('Группа', true))
0 ignored issues
show
Deprecated Code introduced by
The function t() has been deprecated with message: Should be used as $this->system->getContainer()->geti18n()->translate()|plural()

This function has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed from the class and what other function to use instead.

Loading history...
36
        );
37
38
        // Call parent constructor to define all class fields
39
        parent::__construct($renderer, $query, $entity);
40
    }
41
}
42