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

SearchProductsByDescriptionHandler::editQuery()   B

Complexity

Conditions 2
Paths 2

Size

Total Lines 25
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 25
rs 8.8571
cc 2
eloc 14
nc 2
nop 1
1
<?php
2
3
namespace app\components\search;
4
5
6
use app\modules\shop\models\Product;
7
8
class SearchProductsByDescriptionHandler implements SearchInterface
9
{
10
    public static function editQuery(SearchEvent $event)
11
    {
12
        /** @var \app\modules\shop\ShopModule $module */
13
        $module = \Yii::$app->modules['shop'];
14
15
        $event->activeQuery->select('`id`')
16
            ->from(Product::tableName())
17
            ->orWhere('`name` LIKE :q')
18
            ->orWhere('`h1` LIKE :q')
19
            ->orWhere('`content` LIKE :q')
20
            ->orWhere('`sku` LIKE :q')
21
            ->addParams([':q' => '%' . $event->q . '%'])
22
            ->andWhere(
23
                [
24
                    'active' => 1,
25
                ]
26
            );
27
        if ($module->allowSearchGeneratedProducts != 1) {
28
            $event->activeQuery->andWhere(
29
                [
30
                    'parent_id' => 0
31
                ]
32
            );
33
        }
34
    }
35
}