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.
Passed
Push — master ( 3732bd...eba618 )
by Ivan
10:11
created

AddToWishlistWidget   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 12 2
1
<?php
2
3
namespace app\modules\shop\widgets;
4
5
use Yii;
6
use yii\base\Widget;
7
use app;
8
use app\modules\shop\models\Wishlist;
9
10
class AddToWishlistWidget extends Widget
11
{
12
13
    public $id;
14
    public $viewFile = 'wishlist';
15
16
17
    public function run()
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...
18
    {
19
        $wishlists = Wishlist::getWishlist((!Yii::$app->user->isGuest ? Yii::$app->user->id : 0), Yii::$app->session->get('wishlists', []));
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 140 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
20
        $model = new Wishlist();
21
        return $this->render($this->viewFile,
22
            [
23
                'id' => $this->id,
24
                'wishlists' => $wishlists,
25
                'model' => $model,
26
            ]
27
        );
28
    }
29
}