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

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