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