Completed
Push — master ( 92becb...f2a5b4 )
by Matthias
02:20
created

Appveyor::getAuthorEmail()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace MatthiasMullie\CI\Providers;
4
5
use MatthiasMullie\CI\Environment;
6
7
/**
8
 * @see http://www.appveyor.com/docs/environment-variables
9
 *
10
 * @author Matthias Mullie <[email protected]>
11
 * @copyright Copyright (c) 2016, Matthias Mullie. All rights reserved.
12
 * @license LICENSE MIT
13
 */
14
class Appveyor extends None implements Environment
15
{
16
    /**
17
     * {@inheritdoc}
18
     */
19
    public static function isCurrent()
20
    {
21
        return getenv('APPVEYOR') === 'True';
22
    }
23
24
    /**
25
     * {@inheritdoc}
26
     */
27
    public function getProvider()
28
    {
29
        return 'appveyor';
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function getSlug()
36
    {
37
        return getenv('APPVEYOR_REPO_NAME');
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    public function getBranch()
44
    {
45
        return $this->getPullRequest() === '' ? getenv('APPVEYOR_REPO_BRANCH') : '';
46
    }
47
48
    /**
49
     * {@inheritdoc}
50
     */
51
    public function getPullRequest()
52
    {
53
        return getenv('APPVEYOR_PULL_REQUEST_NUMBER') ?: '';
54
    }
55
56
    /**
57
     * {@inheritdoc}
58
     */
59
    public function getCommit()
60
    {
61
        return getenv('APPVEYOR_REPO_COMMIT');
62
    }
63
64
    /**
65
     * {@inheritdoc}
66
     */
67
    public function getAuthor()
68
    {
69
        return getenv('APPVEYOR_REPO_COMMIT_AUTHOR');
70
    }
71
72
    /**
73
     * {@inheritdoc}
74
     */
75
    public function getAuthorEmail()
76
    {
77
        return getenv('APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL');
78
    }
79
80
    /**
81
     * {@inheritdoc}
82
     */
83
    public function getBuild()
84
    {
85
        return getenv('APPVEYOR_BUILD_NUMBER');
86
    }
87
}
88