PermissionSearch   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 6
c 1
b 1
f 0
dl 0
loc 37
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A search() 0 18 1
A rules() 0 3 1
1
<?php
2
3
namespace Itstructure\RbacModule\models;
4
5
use yii\data\ArrayDataProvider;
6
7
/**
8
 * Class PermissionSearch
9
 *
10
 * @package Itstructure\RbacModule\models
11
 */
12
class PermissionSearch extends Permission
13
{
14
    /**
15
     * Modify for custom search rules.
16
     *
17
     * @inheritdoc
18
     */
19
    public function rules()
20
    {
21
        return [];
22
    }
23
24
    /**
25
     * Creates data provider
26
     *
27
     * @param array $params
28
     *
29
     * @return ArrayDataProvider
30
     */
31
    public function search($params)
0 ignored issues
show
Unused Code introduced by
The parameter $params is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

31
    public function search(/** @scrutinizer ignore-unused */ $params)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
32
    {
33
        $allModels = $this->authManager->getPermissions();
34
35
        $dataProvider = new ArrayDataProvider([
36
            'allModels' => $allModels,
37
        ]);
38
39
        /**
40
         * Modify for custom search conditions.
41
         *
42
        $this->load($params);
43
44
        if (!$this->validate()) {
45
            return $dataProvider;
46
        }*/
47
48
        return $dataProvider;
49
    }
50
}
51