Total Complexity | 7 |
Total Lines | 66 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
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) |
||
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() |
||
76 | } |
||
77 | } |
||
78 |