Completed
Push — master ( aad899...3d3dd0 )
by dan
11:58
created

FullyNotifiableTrait::getNumber()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace IrishDan\NotificationBundle;
4
5
/**
6
 * Trait FullyNotifiableTrait
7
 * This trait is handy for getting set up quickly.
8
 *
9
 * @package IrishDan\NotificationBundle
10
 */
11
trait FullyNotifiableTrait
12
{
13
    protected $email;
14
    protected $slackWebhook;
15
    protected $number;
16
17
    /**
18
     * From EmailableInterface
19
     *
20
     * @return string
21
     */
22
    public function getEmail()
23
    {
24
        return $this->mail;
0 ignored issues
show
Bug introduced by
The property mail 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...
25
    }
26
27
    /**
28
     * From SlackableInterface
29
     *
30
     * @return string
31
     */
32
    public function getSlackWebhook()
33
    {
34
        return $this->slackWebhook;
35
    }
36
37
    /**
38
     * From TextableInterface
39
     *
40
     * @return string
41
     */
42
    public function getNumber()
43
    {
44
        return $this->number;
45
    }
46
47
    /**
48
     * From PusherableInterface
49
     *
50
     * @return string
51
     */
52
    public function getPusherChannelSuffix()
53
    {
54
        return '_' . $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...
55
    }
56
}