loadTasks   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 82
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 8
lcom 0
cbo 0
dl 0
loc 82
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A taskDockerRun() 0 4 1
A taskDockerPull() 0 4 1
A taskDockerBuild() 0 4 1
A taskDockerStop() 0 4 1
A taskDockerCommit() 0 4 1
A taskDockerStart() 0 4 1
A taskDockerRemove() 0 4 1
A taskDockerExec() 0 4 1
1
<?php
2
3
namespace Robo\Task\Docker;
4
5
trait loadTasks
6
{
7
    /**
8
     * @param string $image
9
     *
10
     * @return \Robo\Task\Docker\Run|\Robo\Collection\CollectionBuilder
11
     */
12
    protected function taskDockerRun($image)
13
    {
14
        return $this->task(Run::class, $image);
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 string $image
19
     *
20
     * @return \Robo\Task\Docker\Pull|\Robo\Collection\CollectionBuilder
21
     */
22
    protected function taskDockerPull($image)
23
    {
24
        return $this->task(Pull::class, $image);
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 string $path
29
     *
30
     * @return \Robo\Task\Docker\Build|\Robo\Collection\CollectionBuilder
31
     */
32
    protected function taskDockerBuild($path = '.')
33
    {
34
        return $this->task(Build::class, $path);
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 string|\Robo\Task\Docker\Result $cidOrResult
39
     *
40
     * @return \Robo\Task\Docker\Stop|\Robo\Collection\CollectionBuilder
41
     */
42
    protected function taskDockerStop($cidOrResult)
43
    {
44
        return $this->task(Stop::class, $cidOrResult);
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 string|\Robo\Task\Docker\Result $cidOrResult
49
     *
50
     * @return \Robo\Task\Docker\Commit|\Robo\Collection\CollectionBuilder
51
     */
52
    protected function taskDockerCommit($cidOrResult)
53
    {
54
        return $this->task(Commit::class, $cidOrResult);
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
    /**
58
     * @param string|\Robo\Task\Docker\Result $cidOrResult
59
     *
60
     * @return \Robo\Task\Docker\Start|\Robo\Collection\CollectionBuilder
61
     */
62
    protected function taskDockerStart($cidOrResult)
63
    {
64
        return $this->task(Start::class, $cidOrResult);
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...
65
    }
66
67
    /**
68
     * @param string|\Robo\Task\Docker\Result $cidOrResult
69
     *
70
     * @return \Robo\Task\Docker\Remove|\Robo\Collection\CollectionBuilder
71
     */
72
    protected function taskDockerRemove($cidOrResult)
73
    {
74
        return $this->task(Remove::class, $cidOrResult);
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...
75
    }
76
77
    /**
78
     * @param string|\Robo\Task\Docker\Result $cidOrResult
79
     *
80
     * @return \Robo\Task\Docker\Exec|\Robo\Collection\CollectionBuilder
81
     */
82
    protected function taskDockerExec($cidOrResult)
83
    {
84
        return $this->task(Exec::class, $cidOrResult);
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...
85
    }
86
}
87