Completed
Push — master ( 4702cd...b1f1f4 )
by Billie
03:12
created

SuccessStatus::getDetailsUrl()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
declare(strict_types = 1);
3
namespace PurpleBooth\GitGitHubLint\Status;
4
5
/**
6
 * This is the status returned when a validator does not find any problems and no prior commits have had a problem
7
 *
8
 * @package PurpleBooth\GitGitHubLint\Status
9
 */
10
class SuccessStatus implements Status
11
{
12
    /**
13
     * Get the importance of this status.
14
     *
15
     * The lower the value the less important it is, the higher the more important.
16
     *
17
     * @return int
18
     */
19
    public function getWeight() : int
20
    {
21
        return Status::WEIGHT_SUCCESS;
22
    }
23
24
    /**
25
     * A human readable message that describes this state
26
     *
27
     * This will be displayed to the user via the GitHub state
28
     *
29
     * @return string
30
     */
31
    public function getMessage() : string
32
    {
33
        return 'Commit messages looking good!';
34
    }
35
36
    /**
37
     * Is true if the status on GitHub would be success
38
     *
39
     * @return boolean
40
     */
41
    public function isPositive() : bool
42
    {
43
        return $this->getState() == Status::STATE_SUCCESS;
44
    }
45
46
    /**
47
     * The GitHub equivalent of this state
48
     *
49
     * Can be one of pending, success, error, or failure.
50
     *
51
     * @return string
52
     */
53
    public function getState() : string
54
    {
55
        return Status::STATE_SUCCESS;
56
    }
57
58
    /**
59
     * Get a URL with further explanation about this commit message status
60
     *
61
     * @return string
62
     */
63
    public function getDetailsUrl() : string
64
    {
65
        return "http://chris.beams.io/posts/git-commit/";
66
    }
67
}
68