Passed
Push — master ( 69774c...de7969 )
by Sebastian
02:46
created

RuleSet   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 8
c 0
b 0
f 0
dl 0
loc 22
ccs 7
cts 7
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A beams() 0 12 1
1
<?php
2
3
/**
4
 * This file is part of CaptainHook
5
 *
6
 * (c) Sebastian Feldmann <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace CaptainHook\App\Hook\Message\RuleBook;
13
14
use CaptainHook\App\Hook\Message\Rule;
15
16
/**
17
 * Class RuleSet
18
 *
19
 * @package CaptainHook
20
 * @author  Sebastian Feldmann <[email protected]>
21
 * @link    https://github.com/captainhookphp/captainhook
22
 * @since   Class available since Release 2.1.0
23
 */
24
abstract class RuleSet
25
{
26
    /**
27
     * Return Beams rule set
28
     *
29
     * @param  int  $subjectLength
30
     * @param  int  $bodyLineLength
31
     * @param  bool $checkImperativeBeginningOnly
32 4
     * @return \CaptainHook\App\Hook\Message\Rule[]
33
     */
34
    public static function beams(
35
        int $subjectLength = 50,
36
        int $bodyLineLength = 72,
37
        bool $checkImperativeBeginningOnly = false
38 4
    ): array {
39 4
        return [
40 4
            new Rule\CapitalizeSubject(),
41 4
            new Rule\LimitSubjectLength($subjectLength),
42 4
            new Rule\NoPeriodOnSubjectEnd(),
43 4
            new Rule\UseImperativeMood($checkImperativeBeginningOnly),
44
            new Rule\LimitBodyLineLength($bodyLineLength),
45
            new Rule\SeparateSubjectFromBodyWithBlankLine()
46
        ];
47
    }
48
}
49