These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
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
|
|||
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
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;
![]() |
|||
55 | } |
||
56 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: