TicketReference::getTable()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
4
namespace RexlManu\LaravelTickets\Models;
5
6
7
use Illuminate\Database\Eloquent\Model;
8
use RexlManu\LaravelTickets\Traits\HasConfigModel;
9
10
/**
11
 * Class TicketReference
12
 *
13
 * Used to reference a specific model to a ticket
14
 *
15
 * @package RexlManu\LaravelTickets\Models
16
 */
17 View Code Duplication
class TicketReference extends Model
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
18
{
19
20
    use HasConfigModel;
21
22
    public function getTable()
23
    {
24
        return config('laravel-tickets.database.ticket-references-table');
25
    }
26
27
    /**
28
     * Gives the ticket that belongs to it
29
     *
30
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
31
     */
32
    public function ticket()
33
    {
34
        return $this->belongsTo(Ticket::class);
35
    }
36
37
    /**
38
     * Gives the model that is declared as reference
39
     *
40
     * @return \Illuminate\Database\Eloquent\Relations\MorphTo
41
     */
42
    public function referenceable()
43
    {
44
        return $this->morphTo();
45
    }
46
47
}
48