1 | <?php |
||
15 | trait Deprecated |
||
16 | { |
||
17 | /** |
||
18 | * Set the message body. |
||
19 | * |
||
20 | * @param mixed $value |
||
21 | * |
||
22 | * @deprecated use setBody instead |
||
23 | * |
||
24 | * @return $this |
||
25 | */ |
||
26 | public function body($value) |
||
30 | |||
31 | /** |
||
32 | * Set the message subject. |
||
33 | * |
||
34 | * @param mixed $value |
||
35 | * |
||
36 | * @deprecated Use setSubject instead |
||
37 | * |
||
38 | * @return $this |
||
39 | */ |
||
40 | 5 | public function subject($value) |
|
44 | |||
45 | /** |
||
46 | * Set the message url. |
||
47 | * |
||
48 | * @param string $value |
||
49 | * |
||
50 | * @deprecated use setUrl Instead |
||
51 | * |
||
52 | * @return $this |
||
53 | */ |
||
54 | 5 | public function url($value) |
|
58 | |||
59 | /** |
||
60 | * Add a web button to the message. |
||
61 | * |
||
62 | * @param OneSignalWebButton $button |
||
63 | * |
||
64 | * @deprecated use setWebButton instead |
||
65 | * |
||
66 | * @return $this |
||
67 | */ |
||
68 | 1 | public function webButton(OneSignalWebButton $button) |
|
72 | |||
73 | /** |
||
74 | * Adds more than one web button to the message. |
||
75 | * |
||
76 | * @param array[OnSignalWebButton] $buttons |
||
77 | * |
||
78 | * @deprecated use setWebButtons instead |
||
79 | * |
||
80 | * @return $this |
||
81 | */ |
||
82 | public function webButtons(array $buttons) |
||
86 | |||
87 | /** |
||
88 | * Add a native button to the message. |
||
89 | * |
||
90 | * @param OneSignalButton $button |
||
91 | * |
||
92 | * @deprecated use setButton instead |
||
93 | * @return $this |
||
94 | */ |
||
95 | public function button(OneSignalButton $button) |
||
99 | |||
100 | /** |
||
101 | * Adds more than one native button to the message. |
||
102 | * |
||
103 | * @param array $buttons |
||
104 | * |
||
105 | * @deprecated use setButtons instead |
||
106 | * |
||
107 | * @return $this |
||
108 | */ |
||
109 | public function buttons(array $buttons) |
||
113 | } |
This check looks for methods that are used by a trait but not required by it.
To illustrate, let’s look at the following code example
The trait
Idable
provides a methodequalsId
that in turn relies on the methodgetId()
. If this method does not exist on a class mixing in this trait, the method will fail.Adding the
getId()
as an abstract method to the trait will make sure it is available.