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 ( b41112...24729b )
by
unknown
13:18
created

BackendGoogleFeedController::actionCreate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 10

Duplication

Lines 18
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 18
loc 18
rs 9.4286
c 1
b 0
f 0
cc 1
eloc 10
nc 1
nop 0
1
<?php
2
3
namespace app\modules\shop\controllers;
4
5
6
use app\backend\components\BackendController;
7
use app\backgroundtasks\helpers\BackgroundTasks;
8
use app\components\Helper;
9
use app\modules\shop\models\GoogleFeed;
10
use Yii;
11
12
class BackendGoogleFeedController extends BackendController
13
{
14
15
16
    public $defaultAction = 'settings';
17
18
    /**
19
     * @return string|\yii\web\Response
20
     * @throws \yii\web\ServerErrorHttpException
21
     */
22 View Code Duplication
    public function actionSettings()
23
    {
24
        if (\Yii::$app->request->isPost) {
25
            $model = new GoogleFeed();
26
            if (Yii::$app->request->isPost && $model->load(Yii::$app->request->post()) && $model->validate()) {
27
                $model->saveConfig();
28
            } elseif ($model->hasErrors()) {
29
                Yii::$app->session->setFlash('error', Helper::formatModelErrors($model, '<br />'));
30
            }
31
            return $this->refresh();
32
        }
33
        $model = new GoogleFeed();
34
        $model->loadConfig();
35
        return $this->render(
36
            'settings',
37
            [
38
                'model' => $model
39
            ]
40
        );
41
    }
42
43
    /**
44
     * @return \yii\web\Response
45
     */
46 View Code Duplication
    public function actionCreate()
47
    {
48
        BackgroundTasks::addTask(
49
            [
50
                'name' => 'google_merchants_generate',
51
                'description' => 'Creating YML file',
52
                'action' => 'shop/google-merchants/generate',
53
                'params' => '',
54
                'init_event' => 'shop/google_merchants',
55
            ],
56
            [
57
                'create_notification' => true,
58
            ]
59
        );
60
61
        Yii::$app->session->setFlash('success', 'Task has been created.');
62
        return $this->redirect(['settings']);
63
    }
64
65
66
}