SuccessStatus::getWeight()   A
last analyzed

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\GitLintValidators\Status\Status;
6
7
/**
8
 * This is the status returned when a validator does not find any problems and no prior commits have had a problem
9
 *
10
 * @package PurpleBooth\GitGitHubLint\Status
11
 */
12
class SuccessStatus implements Status
13
{
14
    /**
15
     * Get the importance of this status.
16
     *
17
     * The lower the value the less important it is, the higher the more important.
18
     *
19
     * @return int
20
     */
21
    public function getWeight() : int
22
    {
23
        return Status::WEIGHT_SUCCESS;
24
    }
25
26
    /**
27
     * A human readable message that describes this state
28
     *
29
     * This will be displayed to the user via the GitHub state
30
     *
31
     * @return string
32
     */
33
    public function getMessage() : string
34
    {
35
        return 'Commit messages looking good!';
36
    }
37
38
    /**
39
     * Is true if the status on GitHub would be success
40
     *
41
     * @return boolean
42
     */
43
    public function isPositive() : bool
44
    {
45
        return true;
46
    }
47
48
    /**
49
     * Get a URL with further explanation about this commit message status
50
     *
51
     * @return string
52
     */
53
    public function getDetailsUrl() : string
54
    {
55
        return "http://chris.beams.io/posts/git-commit/";
56
    }
57
}
58