DeployBuilder   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 69
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 69
rs 10
c 0
b 0
f 0
wmc 6
lcom 2
cbo 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getConfigFullPath() 0 4 2
A getDeployFileFullPath() 0 10 2
A getTestingDeployFileFullPath() 0 4 1
A getTestingConfigFullPath() 0 4 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: reallyli
5
 * Date: 18/9/28
6
 * Time: 下午12:49.
7
 */
8
9
namespace Reallyli\LaravelDeployer\Concerns;
10
11
/**
12
 * Class DeployBuilder.
13
 */
14
trait DeployBuilder
15
{
16
    /**
17
     * @var string
18
     */
19
    private $deployCustomFilePath = 'deploy.yml';
20
21
    /**
22
     * @var string
23
     */
24
    private $deployExecutableFilePath = 'deploy.php';
25
26
    /**
27
     * Method description:getConfigFullPath.
28
     *
29
     * @author reallyli <[email protected]>
30
     * @return string
31
     * 返回值类型:string,array,object,mixed(多种,不确定的),void(无返回值)
32
     */
33
    public function getConfigFullPath() : string
34
    {
35
        return env('APP_ENV') === 'testing' ? $this->getTestingConfigFullPath() : base_path($this->deployCustomFilePath);
36
    }
37
38
    /**
39
     * Method description:getDeployFileFullPath.
40
     *
41
     * @author reallyli <[email protected]>
42
     * @since 18/9/28
43
     * @return mixed
44
     * 返回值类型:string,array,object,mixed(多种,不确定的),void(无返回值)
45
     */
46
    public function getDeployFileFullPath()
47
    {
48
        if (env('APP_ENV') === 'testing') {
49
            return $this->getTestingDeployFileFullPath();
50
        }
51
52
        $ds = DIRECTORY_SEPARATOR;
53
54
        return "vendor{$ds}{reallyli{$ds}laravel-unideploy}{$ds}.build{$ds}$this->deployExecutableFilePath";
55
    }
56
57
    /**
58
     * Method description:getTestingDeployFileFullPath.
59
     *
60
     * @author reallyli <[email protected]>
61
     * @since 18/9/28
62
     * @return mixed
63
     * 返回值类型:string,array,object,mixed(多种,不确定的),void(无返回值)
64
     */
65
    public function getTestingDeployFileFullPath() : string
66
    {
67
        return realpath(dirname(__DIR__, 3)).'/tests/.build/'.$this->deployExecutableFilePath;
68
    }
69
70
    /**
71
     * Method description:.
72
     *
73
     * @author reallyli <[email protected]>
74
     * @since 18/9/28
75
     * @return string
76
     * 返回值类型:string,array,object,mixed(多种,不确定的),void(无返回值)
77
     */
78
    private function getTestingConfigFullPath() : string
79
    {
80
        return realpath(dirname(__DIR__, 3)).'/tests/Features/'.$this->deployCustomFilePath;
81
    }
82
}
83