Completed
Push — master ( 936afc...005576 )
by Emmanuel
01:16
created

HasTicketReference   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 1
cbo 0
dl 0
loc 10
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A toReference() 0 5 1
1
<?php
2
3
4
namespace RexlManu\LaravelTickets\Traits;
5
6
7
trait HasTicketReference
8
{
9
10
    public function toReference() : string
11
    {
12
        $type = get_class($this);
13
        return "$type,$this->id";
0 ignored issues
show
Bug introduced by
The property id does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
14
    }
15
16
}
17