| 1 | <?php |
||
| 5 | trait loadTasks |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @param string $input |
||
| 9 | * |
||
| 10 | * @return \Robo\Task\Assets\Minify|\Robo\Collection\CollectionBuilder |
||
| 11 | */ |
||
| 12 | protected function taskMinify($input) |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @param string|string[] $input |
||
| 19 | * |
||
| 20 | * @return \Robo\Task\Assets\ImageMinify|\Robo\Collection\CollectionBuilder |
||
| 21 | */ |
||
| 22 | protected function taskImageMinify($input) |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param array $input |
||
| 29 | * |
||
| 30 | * @return \Robo\Task\Assets\Less|\Robo\Collection\CollectionBuilder |
||
| 31 | */ |
||
| 32 | protected function taskLess($input) |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @param array $input |
||
| 39 | * |
||
| 40 | * @return \Robo\Task\Assets\Scss|\Robo\Collection\CollectionBuilder |
||
| 41 | */ |
||
| 42 | protected function taskScss($input) |
||
| 46 | } |
||
| 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.