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.
Completed
Push — master ( fa2630...81edb2 )
by Alireza
08:56
created

Permission::getAndSave()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 5
rs 9.4285
cc 1
eloc 4
nc 1
nop 2
1
<?php
2
3
namespace Serverfireteam\Panel;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class Permission extends Model
8
{
9
    /**
10
     * A permission can be applied to roles.
11
     *
12
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
13
     */
14
    
15
    protected $fillable = array('name', 'label');
16
17
    public function roles()
18
    {
19
    	return $this->belongsToMany(Role::class);
20
    }
21
22
    public function getAndSave($url, $label){
23
    	$this->name = $name;
0 ignored issues
show
Bug introduced by
The variable $name does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
24
    	$this->label = $label;
25
    	$this->save();
26
    }
27
}
28