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.

Issues (71)

src/Models/TypeformAuthCode.php (9 issues)

1
<?php
2
0 ignored issues
show
Missing file doc comment
Loading history...
3
namespace BristolSU\Service\Typeform\Models;
4
5
use BristolSU\Support\User\Contracts\UserAuthentication;
6
use Illuminate\Database\Eloquent\Builder;
7
use Illuminate\Database\Eloquent\Model;
8
use Carbon\Carbon;
9
use Illuminate\Support\Facades\Crypt;
10
11
class TypeformAuthCode extends Model
0 ignored issues
show
Missing doc comment for class TypeformAuthCode
Loading history...
12
{
13
14
    protected $hidden = [
15
        'auth_code', 'expires_at', 'refresh_token'
16
    ];
17
18
    protected $casts = [
19
        'expires_at' => 'datetime'
20
    ];
21
22
    /**
23
     * Scope auth codes to show to the user to select.
24
     * 
25
     * These auth codes must both belong to the user, and have been created in the last 10 minutes.
26
     * 
27
     * @param Builder $query
0 ignored issues
show
Missing parameter comment
Loading history...
28
     */
0 ignored issues
show
Missing @return tag in function comment
Loading history...
29 2
    public function scopeValid(Builder $query)
30
    {
31 2
        $query->where('user_id', app(UserAuthentication::class)->getUser()->control_id)
32 2
            ->where('created_at', '>=', Carbon::now()->subMinutes(10))
33 2
            ->orderBy('created_at', 'DESC');
34 2
    }
35
36 8
    public function isValid()
0 ignored issues
show
Missing doc comment for function isValid()
Loading history...
37
    {
38 8
        return $this->expires_at->isFuture();
39
    }
40
41 16
    public function setAuthCodeAttribute($authCode)
0 ignored issues
show
Missing doc comment for function setAuthCodeAttribute()
Loading history...
42
    {
43 16
        $this->attributes['auth_code'] = Crypt::encrypt($authCode);
44 16
    }
45
46 6
    public function getAuthCodeAttribute($authCode)
0 ignored issues
show
Missing doc comment for function getAuthCodeAttribute()
Loading history...
47
    {
48 6
        return Crypt::decrypt($authCode);
49
    }
50
51 16
    public function setRefreshTokenAttribute($refreshToken)
0 ignored issues
show
Missing doc comment for function setRefreshTokenAttribute()
Loading history...
52
    {
53 16
        $this->attributes['refresh_token'] = Crypt::encrypt($refreshToken);
54 16
    }
55
56 3
    public function getRefreshTokenAttribute($refreshToken)
0 ignored issues
show
Missing doc comment for function getRefreshTokenAttribute()
Loading history...
57
    {
58 3
        return Crypt::decrypt($refreshToken);
59
    }
60
    
61
}