GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Test Setup Failed
Push — filters ( 0da638...f31b5a )
by
unknown
16:04
created

SearchEvent::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 8
rs 9.4286
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
namespace app\components\search;
4
5
6
use yii\base\Event;
7
use yii\helpers\ArrayHelper;
8
9
class SearchEvent extends Event
10
{
11
12
    public $activeQuery = null;
13
    public $q = null;
14
    public $functionSearch;
15
16
    public function init()
17
    {
18
        $this->functionSearch = function($activeQuery){
19
          return ArrayHelper::getColumn($activeQuery->all(), 'id');
20
        };
21
22
        parent::init();
23
    }
24
    public function getAll()
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
25
    {
26
        $result = [];
27
        if(is_callable($this->functionSearch)) {
28
            $method = $this->functionSearch;
29
            $result = $method($this->activeQuery);
30
        }
31
        return $result;
32
    }
33
34
}