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 ( 00a000...182d7a )
by Piyapan
03:21
created

Post   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 20
dl 0
loc 48
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A sluggable() 0 7 1
A boot() 0 25 1
1
<?php
2
3
namespace Raystech\StarterKit\Models;
4
5
use Illuminate\Database\Eloquent\Model;
6
use Cviebrock\EloquentSluggable\Sluggable;
7
8
use Raystech\StarterKit\Traits\CustomSlugify;
9
10
class Post extends Model
11
{
12
  use CustomSlugify;
13
  use Sluggable;
14
15
  protected $fillable = [
16
    'post_author', 'post_content', 'post_title', 
17
    'post_excerpt', 'post_status', 'comment_status', 'ping_status', 'post_password', 
18
    'post_name', 'to_ping', 'pinged',
19
    'post_content_filtered', 'post_parent', 'guid', 'menu_order', 'post_type', 'post_mime_type', 'comment_count'
20
  ];
21
  
22
  public static function boot()
23
  {
24
    parent::boot();
25
26
    self::creating(function($model){
0 ignored issues
show
Unused Code introduced by
The parameter $model is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

26
    self::creating(function(/** @scrutinizer ignore-unused */ $model){

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
27
      // ... code here
28
    });
29
30
    self::created(function($model){
0 ignored issues
show
Unused Code introduced by
The parameter $model is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

30
    self::created(function(/** @scrutinizer ignore-unused */ $model){

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
31
      // ... code here
32
    });
33
34
    self::updating(function($model){
0 ignored issues
show
Unused Code introduced by
The parameter $model is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

34
    self::updating(function(/** @scrutinizer ignore-unused */ $model){

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
35
      // ... code here
36
    });
37
38
    self::updated(function($model){
0 ignored issues
show
Unused Code introduced by
The parameter $model is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

38
    self::updated(function(/** @scrutinizer ignore-unused */ $model){

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
39
      // ... code here
40
    });
41
42
    self::deleting(function($model){
0 ignored issues
show
Unused Code introduced by
The parameter $model is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

42
    self::deleting(function(/** @scrutinizer ignore-unused */ $model){

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
43
      // ... code here
44
    });
45
46
    self::deleted(function($model){
0 ignored issues
show
Unused Code introduced by
The parameter $model is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

46
    self::deleted(function(/** @scrutinizer ignore-unused */ $model){

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
47
      // ... code here
48
    });
49
  }
50
51
  public function sluggable()
52
  {
53
    return [
54
      'post_name' => [
55
        'source' => 'post_title',
56
        'method' => function ($string, $separator) {
57
          return $this->slugify_th($string, $separator);
58
        }
59
      ]
60
    ];
61
  }
62
}
63