Code Duplication    Length = 10-11 lines in 6 locations

src/Task/Bower/Base.php 1 location

@@ 78-87 (lines=10) @@
75
     *
76
     * @throws \Robo\Exception\TaskException
77
     */
78
    public function __construct($pathToBower = null)
79
    {
80
        $this->command = $pathToBower;
81
        if (!$this->command) {
82
            $this->command = $this->findExecutable('bower');
83
        }
84
        if (!$this->command) {
85
            throw new TaskException(__CLASS__, "Bower executable not found.");
86
        }
87
    }
88
89
    /**
90
     * @return string

src/Task/Gulp/Base.php 1 location

@@ 78-88 (lines=11) @@
75
     *
76
     * @throws \Robo\Exception\TaskException
77
     */
78
    public function __construct($task, $pathToGulp = null)
79
    {
80
        $this->task = $task;
81
        $this->command = $pathToGulp;
82
        if (!$this->command) {
83
            $this->command = $this->findExecutable('gulp');
84
        }
85
        if (!$this->command) {
86
            throw new TaskException(__CLASS__, "Gulp executable not found.");
87
        }
88
    }
89
90
    /**
91
     * @return string

src/Task/Npm/Base.php 1 location

@@ 43-52 (lines=10) @@
40
     *
41
     * @throws \Robo\Exception\TaskException
42
     */
43
    public function __construct($pathToNpm = null)
44
    {
45
        $this->command = $pathToNpm;
46
        if (!$this->command) {
47
            $this->command = $this->findExecutable('npm');
48
        }
49
        if (!$this->command) {
50
            throw new TaskException(__CLASS__, "Npm executable not found.");
51
        }
52
    }
53
54
    /**
55
     * @return string

src/Task/Testing/Atoum.php 1 location

@@ 38-47 (lines=10) @@
35
     *
36
     * @throws \Robo\Exception\TaskException
37
     */
38
    public function __construct($pathToAtoum = null)
39
    {
40
        $this->command = $pathToAtoum;
41
        if (!$this->command) {
42
            $this->command = $this->findExecutable('atoum');
43
        }
44
        if (!$this->command) {
45
            throw new \Robo\Exception\TaskException(__CLASS__, "Neither local atoum nor global composer installation not found");
46
        }
47
    }
48
49
    /**
50
     * Tag or Tags to filter.

src/Task/Testing/Behat.php 1 location

@@ 48-57 (lines=10) @@
45
     *
46
     * @throws \Robo\Exception\TaskException
47
     */
48
    public function __construct($pathToBehat = null)
49
    {
50
        $this->command = $pathToBehat;
51
        if (!$this->command) {
52
            $this->command = $this->findExecutable('behat');
53
        }
54
        if (!$this->command) {
55
            throw new \Robo\Exception\TaskException(__CLASS__, "Neither composer nor phar installation of Behat found");
56
        }
57
    }
58
59
    /**
60
     * @return $this

src/Task/Testing/Phpspec.php 1 location

@@ 50-60 (lines=11) @@
47
     *
48
     * @throws \Robo\Exception\TaskException
49
     */
50
    public function __construct($pathToPhpspec = null)
51
    {
52
        $this->command = $pathToPhpspec;
53
        if (!$this->command) {
54
            $this->command = $this->findExecutable('phpspec');
55
        }
56
        if (!$this->command) {
57
            throw new \Robo\Exception\TaskException(__CLASS__, "Neither composer nor phar installation of Phpspec found");
58
        }
59
        $this->arg('run');
60
    }
61
62
    public function stopOnFail()
63
    {