1 | <?php |
||
8 | trait Deprecated |
||
9 | { |
||
10 | /** |
||
11 | * Set the message body. |
||
12 | * |
||
13 | * @param mixed $value |
||
14 | * |
||
15 | * @deprecated use setBody instead |
||
16 | * |
||
17 | * @return $this |
||
18 | */ |
||
19 | public function body($value) |
||
23 | |||
24 | /** |
||
25 | * Set the message subject. |
||
26 | * |
||
27 | * @param mixed $value |
||
28 | * |
||
29 | * @deprecated Use setSubject instead |
||
30 | * |
||
31 | * @return $this |
||
32 | */ |
||
33 | 9 | public function subject($value) |
|
37 | |||
38 | /** |
||
39 | * Set the message url. |
||
40 | * |
||
41 | * @param string $value |
||
42 | * |
||
43 | * @deprecated use setUrl Instead |
||
44 | * |
||
45 | * @return $this |
||
46 | */ |
||
47 | 9 | public function url($value) |
|
51 | |||
52 | /** |
||
53 | * Add a web button to the message. |
||
54 | * |
||
55 | * @param OneSignalWebButton $button |
||
56 | * |
||
57 | * @deprecated use setWebButton instead |
||
58 | * |
||
59 | * @return $this |
||
60 | */ |
||
61 | 1 | public function webButton(OneSignalWebButton $button) |
|
65 | |||
66 | /** |
||
67 | * Adds more than one web button to the message. |
||
68 | * |
||
69 | * @param array[OnSignalWebButton] $buttons |
||
70 | * |
||
71 | * @deprecated use setWebButtons instead |
||
72 | * |
||
73 | * @return $this |
||
74 | */ |
||
75 | public function webButtons(array $buttons) |
||
79 | |||
80 | /** |
||
81 | * Add a native button to the message. |
||
82 | * |
||
83 | * @param OneSignalButton $button |
||
84 | * |
||
85 | * @deprecated use setButton instead |
||
86 | * @return $this |
||
87 | */ |
||
88 | public function button(OneSignalButton $button) |
||
92 | |||
93 | /** |
||
94 | * Adds more than one native button to the message. |
||
95 | * |
||
96 | * @param array $buttons |
||
97 | * |
||
98 | * @deprecated use setButtons instead |
||
99 | * |
||
100 | * @return $this |
||
101 | */ |
||
102 | public function buttons(array $buttons) |
||
106 | } |
||
107 |
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.