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

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
3
declare(strict_types = 1);
4
5
namespace PurpleBooth\GitGitHubLint\Status;
6
7
use PurpleBooth\GitGitHubLint\Validator\DoNotEndTheSubjectLineWithAPeriodValidator;
8
9
/**
10
 * This is the status returned when the DoNotEndTheSubjectLineWithAPeriodValidator identifies a problem
11
 *
12
 * @see     DoNotEndTheSubjectLineWithAPeriodValidator
13
 *
14
 * @package PurpleBooth\GitGitHubLint\Status
15
 */
16
class DoNotEndTheSubjectLineWithAPeriodStatus implements Status
17
{
18
    /**
19
     * Get the importance of this status.
20
     *
21
     * The lower the value the less important it is, the higher the more important.
22
     *
23
     * @return int
24
     */
25
    public function getWeight() : int
26
    {
27
        return Status::WEIGHT_ERROR;
28
    }
29
30
    /**
31
     * A human readable message that describes this state
32
     *
33
     * This will be displayed to the user via the GitHub state
34
     *
35
     * @return string
36
     */
37
    public function getMessage() : string
38
    {
39
        return 'Please remove the full stop at the end of the subject line of the commit message';
40
    }
41
42
    /**
43
     * Is true if the status on GitHub would be success
44
     *
45
     * @return boolean
46
     */
47
    public function isPositive() : bool
48
    {
49
        return $this->getState() == Status::STATE_SUCCESS;
50
    }
51
52
    /**
53
     * The GitHub equivalent of this state
54
     *
55
     * Can be one of pending, success, error, or failure.
56
     *
57
     * @return string
58
     */
59
    public function getState() : string
60
    {
61
        return Status::STATE_FAILURE;
62
    }
63
64
    /**
65
     * Get a URL with further explanation about this commit message status
66
     *
67
     * @return string
68
     */
69
    public function getDetailsUrl() : string
70
    {
71
        return "http://chris.beams.io/posts/git-commit/#end";
72
    }
73
}
74