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.

Crudable::crudEntry()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 0
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
1
<?php
2
3
namespace Akibatech\Crud\Traits;
4
5
use Akibatech\Crud\Crud;
6
use Akibatech\Crud\Services\CrudEntry;
7
use Akibatech\Crud\Services\CrudFields;
8
use Akibatech\Crud\Services\CrudManager;
9
use Akibatech\Crud\Services\CrudTable;
10
11
/**
12
 * Class Crudable
13
 *
14
 * @package Akibatech\Crud\Traits\Crudable
15
 */
16
trait Crudable
17
{
18
    /**
19
     * @var CrudEntry
20
     */
21
    protected $crud_entry;
22
23
    /**
24
     * @var CrudTable
25
     */
26
    protected $crud_table;
27
28
    /**
29
     * @param   void
30
     * @return  CrudEntry
31
     * @throws  \Akibatech\Crud\Exceptions\InvalidArgumentException
32
     */
33
    public function crudEntry()
34
    {
35
        if (is_null($this->crud_entry))
36
        {
37
            $this->crud_entry = Crud::entry($this);
38
        }
39
40
        return $this->crud_entry;
41
    }
42
43
    /**
44
     * @param   void
45
     * @return  CrudTable
46
     * @throws  \Akibatech\Crud\Exceptions\InvalidArgumentException
47
     */
48
    public function crudTable()
49
    {
50
        if (is_null($this->crud_table))
51
        {
52
            $this->crud_table = Crud::table($this);
53
        }
54
55
        return $this->crud_table;
56
    }
57
58
    /**
59
     * Returns model fields configuration.
60
     *
61
     * @param   void
62
     * @return  CrudFields
63
     */
64
    abstract public function getCrudFields();
65
66
    /**
67
     * Returns the CRUD configuration.
68
     *
69
     * @param   void
70
     * @return  CrudManager
71
     */
72
    public function getCrudManager()
73
    {
74
        return CrudManager::make($this);
75
    }
76
77
    /**
78
     * @param   void
79
     * @return  CrudManager
80
     */
81
    public static function crudRoutes()
82
    {
83
        return (new static)->getCrudManager()->registerRoutes();
84
    }
85
}
86