1 | <?php |
||
5 | trait GroupingHelpers |
||
6 | { |
||
7 | /** |
||
8 | * Set the Android Grouping Parameters. |
||
9 | * @param string $group |
||
10 | * @param array $groupMessage |
||
11 | * |
||
12 | * @return $this |
||
13 | */ |
||
14 | public function setAndroidGroup(string $group, array $groupMessage) |
||
19 | |||
20 | /** |
||
21 | * Set the Amazon (FireOS) Grouping Parameters. |
||
22 | * @param string $group |
||
23 | * @param array $groupMessage |
||
24 | * |
||
25 | * @return $this |
||
26 | */ |
||
27 | public function setAmazonGroup(string $group, array $groupMessage) |
||
32 | |||
33 | /** |
||
34 | * Set the Grouping Parameters for all available Systems (currently Android and Amazon (FireOs)). |
||
35 | * @param string $group |
||
36 | * @param array $groupMessage |
||
37 | * |
||
38 | * @return $this |
||
39 | */ |
||
40 | public function setGroup(string $group, array $groupMessage) |
||
45 | } |
||
46 |
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.