loadTasks::taskCleanDir()   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\Filesystem;
4
5
trait loadTasks
6
{
7
    /**
8
     * @param string|string[] $dirs
9
     *
10
     * @return \Robo\Task\Filesystem\CleanDir|\Robo\Collection\CollectionBuilder
11
     */
12
    protected function taskCleanDir($dirs)
13
    {
14
        return $this->task(CleanDir::class, $dirs);
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|string[] $dirs
19
     *
20
     * @return \Robo\Task\Filesystem\DeleteDir|\Robo\Collection\CollectionBuilder
21
     */
22
    protected function taskDeleteDir($dirs)
23
    {
24
        return $this->task(DeleteDir::class, $dirs);
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 $prefix
29
     * @param string $base
30
     * @param bool $includeRandomPart
31
     *
32
     * @return \Robo\Task\Filesystem\WorkDir|\Robo\Collection\CollectionBuilder
33
     */
34
    protected function taskTmpDir($prefix = 'tmp', $base = '', $includeRandomPart = true)
35
    {
36
        return $this->task(TmpDir::class, $prefix, $base, $includeRandomPart);
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...
37
    }
38
39
    /**
40
     * @param string $finalDestination
41
     *
42
     * @return \Robo\Task\Filesystem\TmpDir|\Robo\Collection\CollectionBuilder
43
     */
44
    protected function taskWorkDir($finalDestination)
45
    {
46
        return $this->task(WorkDir::class, $finalDestination);
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...
47
    }
48
49
    /**
50
     * @param string|string[] $dirs
51
     *
52
     * @return \Robo\Task\Filesystem\CopyDir|\Robo\Collection\CollectionBuilder
53
     */
54
    protected function taskCopyDir($dirs)
55
    {
56
        return $this->task(CopyDir::class, $dirs);
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...
57
    }
58
59
    /**
60
     * @param string|string[] $dirs
61
     *
62
     * @return \Robo\Task\Filesystem\MirrorDir|\Robo\Collection\CollectionBuilder
63
     */
64
    protected function taskMirrorDir($dirs)
65
    {
66
        return $this->task(MirrorDir::class, $dirs);
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...
67
    }
68
69
    /**
70
     * @param string|string[] $dirs
71
     *
72
     * @return \Robo\Task\Filesystem\FlattenDir|\Robo\Collection\CollectionBuilder
73
     */
74
    protected function taskFlattenDir($dirs)
75
    {
76
        return $this->task(FlattenDir::class, $dirs);
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...
77
    }
78
79
    /**
80
     * @return \Robo\Task\Filesystem\FilesystemStack|\Robo\Collection\CollectionBuilder
81
     */
82
    protected function taskFilesystemStack()
83
    {
84
        return $this->task(FilesystemStack::class);
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