Completed
Push — master ( 061d1e...31cfb3 )
by Greg
02:26
created

src/Task/Testing/loadTasks.php (1 issue)

Upgrade to new PHP Analysis Engine

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
It seems like task() must be provided by classes using this trait. How about adding it as abstract method to this trait?

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

trait Idable {
    public function equalIds(Idable $other) {
        return $this->getId() === $other->getId();
    }
}

The trait Idable provides a method equalsId that in turn relies on the method getId(). 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.

Loading history...
54
    }
55
}
56