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

SearchProductsByPropertyHandler::editQuery()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 23
rs 9.0857
cc 1
eloc 15
nc 1
nop 1
1
<?php
2
3
namespace app\components\search;
4
5
6
use app\models\ObjectStaticValues;
7
use app\models\PropertyStaticValues;
8
use yii\db\Query;
9
use yii\helpers\ArrayHelper;
10
11
class SearchProductsByPropertyHandler implements SearchInterface
12
{
13
    public static function editQuery(SearchEvent $event)
14
    {
15
        /** @var \app\modules\shop\ShopModule $module */
16
        $properties = (new Query())
17
            ->select('`id`')
18
            ->from(PropertyStaticValues::tableName())
19
            ->where('`name` LIKE :q')
20
            ->addParams([':q' => '%' . $event->q . '%'])
21
            ->all();
22
23
24
        $event->activeQuery->select('`object_model_id`')
25
            ->distinct(true)
26
            ->from(ObjectStaticValues::tableName())
27
            ->where('`object_id` = :objectId')
28
            ->addParams([':objectId' => 1])
29
            ->andWhere(['in', '`property_static_value_id`', ArrayHelper::getColumn($properties, 'id')]);
30
31
        $event->functionSearch = function ($activeQuery) {
32
            return ArrayHelper::getColumn($activeQuery->all(), 'object_model_id');
33
        };
34
35
    }
36
}