loadTasks::taskPhpspec()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Robo\Task\Testing;
4
5
trait loadTasks
6
{
7
    /**
8
     * @param null|string $pathToCodeception
9
     *
10
     * @return \Robo\Task\Testing\Codecept|\Robo\Collection\CollectionBuilder
11
     */
12
    protected function taskCodecept($pathToCodeception = null)
13
    {
14
        return $this->task(Codecept::class, $pathToCodeception);
0 ignored issues
show
Bug introduced by
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...
15
    }
16
17
    /**
18
     * @param null|string $pathToPhpUnit
19
     *
20
     * @return \Robo\Task\Testing\PHPUnit|\Robo\Collection\CollectionBuilder
21
     */
22
    protected function taskPhpUnit($pathToPhpUnit = null)
23
    {
24
        return $this->task(PHPUnit::class, $pathToPhpUnit);
0 ignored issues
show
Bug introduced by
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...
25
    }
26
27
    /**
28
     * @param null|string $pathToPhpspec
29
     *
30
     * @return \Robo\Task\Testing\Phpspec|\Robo\Collection\CollectionBuilder
31
     */
32
    protected function taskPhpspec($pathToPhpspec = null)
33
    {
34
        return $this->task(Phpspec::class, $pathToPhpspec);
0 ignored issues
show
Bug introduced by
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...
35
    }
36
37
    /**
38
     * @param null|string $pathToAtoum
39
     *
40
     * @return \Robo\Task\Testing\Atoum|\Robo\Collection\CollectionBuilder
41
     */
42
    protected function taskAtoum($pathToAtoum = null)
43
    {
44
        return $this->task(Atoum::class, $pathToAtoum);
0 ignored issues
show
Bug introduced by
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...
45
    }
46
47
    /**
48
     * @param null|string $pathToBehat
49
     *
50
     * @return \Robo\Task\Testing\Behat|\Robo\Collection\CollectionBuilder
51
     */
52
    protected function taskBehat($pathToBehat = null)
53
    {
54
        return $this->task(Behat::class, $pathToBehat);
0 ignored issues
show
Bug introduced by
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...
55
    }
56
}
57