Failed Conditions
Pull Request — master (#10)
by Maximo
03:34
created

RolesController::onConstruct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 8
ccs 0
cts 6
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
0 ignored issues
show
Coding Style introduced by
End of line character is invalid; expected "\n" but found "\r\n"
Loading history...
2
declare(strict_types=1);
3
4
namespace Gewaer\Api\Controllers;
5
6
use Gewaer\Models\Roles;
7
8
/**
9
 * Class RolesController
10
 *
11
 * @package Gewaer\Api\Controllers
12
 *
13
 * @property Users $userData
14
 */
15
class RolesController extends BaseController
16
{
17
    /*
18
     * fields we accept to create
19
     *
20
     * @var array
21
     */
22
    protected $createFields = [];
23
24
    /*
25
     * fields we accept to create
26
     *
27
     * @var array
28
     */
29
    protected $updateFields = [];
30
31
    /**
32
     * set objects
33
     *
34
     * @return void
35
     */
36
    public function onConstruct()
37
    {
38
        $this->model = new Roles();
0 ignored issues
show
Documentation Bug introduced by
It seems like new Gewaer\Models\Roles() of type Gewaer\Models\Roles is incompatible with the declared type array of property $model.

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...
39
40
        //get the list of roes for the systema + my company
41
        $this->additionalSearchFields = [
42
            ['is_deleted', ':', 0],
43
            ['company_id', ':', '(0,' . $this->userData->default_company . ')'],
44
        ];
45
    }
46
}
47