These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | namespace Robo\Task\Testing; |
||
3 | |||
4 | trait loadTasks |
||
5 | { |
||
6 | /** |
||
7 | * @param null|string $pathToCodeception |
||
8 | * |
||
9 | * @return \Robo\Task\Testing\Codecept |
||
10 | */ |
||
11 | protected function taskCodecept($pathToCodeception = null) |
||
12 | { |
||
13 | return $this->task(Codecept::class, $pathToCodeception); |
||
14 | } |
||
15 | |||
16 | /** |
||
17 | * @param null|string $pathToPhpUnit |
||
18 | * |
||
19 | * @return \Robo\Task\Testing\PHPUnit |
||
20 | */ |
||
21 | protected function taskPhpUnit($pathToPhpUnit = null) |
||
22 | { |
||
23 | return $this->task(PHPUnit::class, $pathToPhpUnit); |
||
24 | } |
||
25 | |||
26 | /** |
||
27 | * @param null $pathToPhpspec |
||
28 | * |
||
29 | * @return \Robo\Task\Testing\Phpspec |
||
30 | */ |
||
31 | protected function taskPhpspec($pathToPhpspec = null) |
||
32 | { |
||
33 | return $this->task(Phpspec::class, $pathToPhpspec); |
||
34 | } |
||
35 | |||
36 | /** |
||
37 | * @param null $pathToAtoum |
||
38 | * |
||
39 | * @return \Robo\Task\Testing\Atoum |
||
40 | */ |
||
41 | protected function taskAtoum($pathToAtoum = null) |
||
42 | { |
||
43 | return $this->task(Atoum::class, $pathToAtoum); |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * @param null $pathToBehat |
||
48 | * |
||
49 | * @return \Robo\Task\Testing\Behat |
||
50 | */ |
||
51 | protected function taskBehat($pathToBehat = null) |
||
52 | { |
||
53 | return $this->task(Behat::class, $pathToBehat); |
||
0 ignored issues
–
show
|
|||
54 | } |
||
55 | } |
||
56 |
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.