CloneGitRepositoryTask::completed()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 0
nc 1
nop 0
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace App;
4
5
use App\Pipes\CloneGitRepository;
6
use App\Pipes\SetupGitDirectory;
7
use Zurbaev\PipelineTasks\Exceptions\PipelineTaskFailedException;
8
use Zurbaev\PipelineTasks\Task;
9
10
class CloneGitRepositoryTask extends Task
11
{
12
    /**
13
     * @var string
14
     */
15
    protected $gitUrl;
16
17
    /**
18
     * @var string
19
     */
20
    protected $branch;
21
22
    /**
23
     * @var string
24
     */
25
    protected $rootPath;
26
27
    /**
28
     * CloneGitRepositoryTask constructor.
29
     *
30
     * @param string $gitUrl
31
     * @param string $branch
32
     * @param string $rootPath
33
     */
34
    public function __construct(string $gitUrl, string $branch, string $rootPath)
35
    {
36
        $this->gitUrl = $gitUrl;
37
        $this->branch = $branch;
38
        $this->rootPath = $rootPath;
39
    }
40
41
    public function pipes()
42
    {
43
        // If you have any dependencies defined in the
44
        // constructor and/or `handle` method, they
45
        // will be injected by the Laravel's DI.
46
47
        return [
48
            new SetupGitDirectory($this->getRootPath()),
49
            CloneGitRepository::class,
50
        ];
51
    }
52
53
    public function completed()
54
    {
55
        // Send successful notification here, etc.
56
    }
57
58
    public function failed(PipelineTaskFailedException $e)
59
    {
60
        // Send failed notification here, etc.
61
    }
62
63
    public function getGitUrl()
64
    {
65
        return $this->gitUrl;
66
    }
67
68
    public function getBranch()
69
    {
70
        return $this->branch;
71
    }
72
73
    public function getRootPath()
74
    {
75
        return $this->rootPath;
76
    }
77
}
78