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

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