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 ( 9e7309...ca86c4 )
by Aden
39:37 queued 06:18
created

ModelCloning   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A excludeOnClone() 0 8 1
A unCloneableColumns() 0 6 1
1
<?php
2
3
namespace LaravelFlare\Flare\Admin\Models\Traits;
4
5
trait ModelCloning
6
{
7
    /**
8
     * An Array of Fields to Exclude on Clone.
9
     *
10
     * When cloning a Model ceratin data might need to be skipped
11
     * either because it is irrelevant (such as datestamps) or
12
     * because it is primary or unique data in the database.
13
     * 
14
     * @return array
15
     */
16
    public function excludeOnClone()
17
    {
18
        return [
19
            $this->model->getKeyName(),
20
            $this->model->getCreatedAtColumn(),
21
            $this->model->getUpdatedAtColumn(),
22
        ];
23
    }
24
25
    /**
26
     * 
27
     */
28
    public function unCloneableColumns()
29
    {
30
        // We will use this: SHOW INDEXES FROM users WHERE Non_unique != 0 AND Column_name != 'id'
31
        // To determine if there are unCloneable Columns and if that is the case, we will render
32
        // the clone view and validate the unCloneable Columns to be unique before saving.
33
    }
34
}
35