| 1 | <?php |
||
| 5 | trait loadTasks |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @param string $username |
||
| 9 | * @param string $password |
||
| 10 | * @param string $pathToSvn |
||
| 11 | * |
||
| 12 | * @return \Robo\Task\Vcs\SvnStack|\Robo\Collection\CollectionBuilder |
||
| 13 | */ |
||
| 14 | protected function taskSvnStack($username = '', $password = '', $pathToSvn = 'svn') |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @param string $pathToGit |
||
| 21 | * |
||
| 22 | * @return \Robo\Task\Vcs\GitStack|\Robo\Collection\CollectionBuilder |
||
| 23 | */ |
||
| 24 | protected function taskGitStack($pathToGit = 'git') |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @param string $pathToHg |
||
| 31 | * |
||
| 32 | * @return \Robo\Task\Vcs\HgStack|\Robo\Collection\CollectionBuilder |
||
| 33 | */ |
||
| 34 | protected function taskHgStack($pathToHg = 'hg') |
||
| 38 | } |
||
| 39 |
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.