1 | <?php |
||
5 | trait loadTasks |
||
6 | { |
||
7 | /** |
||
8 | * @param string|\Robo\Contract\CommandInterface $command |
||
9 | * |
||
10 | * @return \Robo\Task\Base\Exec|\Robo\Collection\CollectionBuilder |
||
11 | */ |
||
12 | protected function taskExec($command) |
||
16 | |||
17 | /** |
||
18 | * @return \Robo\Task\Base\ExecStack|\Robo\Collection\CollectionBuilder |
||
19 | */ |
||
20 | protected function taskExecStack() |
||
24 | |||
25 | /** |
||
26 | * @return \Robo\Task\Base\ParallelExec|\Robo\Collection\CollectionBuilder |
||
27 | */ |
||
28 | protected function taskParallelExec() |
||
32 | |||
33 | /** |
||
34 | * @param \Symfony\Component\Console\Command\Command $command |
||
35 | * |
||
36 | * @return \Robo\Task\Base\SymfonyCommand|\Robo\Collection\CollectionBuilder |
||
37 | */ |
||
38 | protected function taskSymfonyCommand($command) |
||
42 | |||
43 | /** |
||
44 | * @return \Robo\Task\Base\Watch|\Robo\Collection\CollectionBuilder |
||
45 | */ |
||
46 | protected function taskWatch() |
||
50 | } |
||
51 |
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.