ValidatorFactoryImplementation   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 7

Importance

Changes 0
Metric Value
dl 0
loc 23
c 0
b 0
f 0
wmc 1
lcom 0
cbo 7
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getMessageValidator() 0 15 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * Copyright (C) 2016 Billie Thompson
7
 *
8
 * This software may be modified and distributed under the terms
9
 * of the MIT license.  See the LICENSE file for details.
10
 */
11
12
namespace PurpleBooth\GitLintValidators;
13
14
use PurpleBooth\GitLintValidators\Validator\CapitalizeTheSubjectLineValidator;
15
use PurpleBooth\GitLintValidators\Validator\DoNotEndTheSubjectLineWithAPeriodValidator;
16
use PurpleBooth\GitLintValidators\Validator\LimitTheBodyWrapLengthTo72CharactersValidator;
17
use PurpleBooth\GitLintValidators\Validator\LimitTheTitleLengthTo69CharactersValidator;
18
use PurpleBooth\GitLintValidators\Validator\SeparateSubjectFromBodyWithABlankLineValidator;
19
use PurpleBooth\GitLintValidators\Validator\SoftLimitTheTitleLengthTo50CharactersValidator;
20
21
/**
22
 * Build a ready ValidateMessage.
23
 */
24
class ValidatorFactoryImplementation implements ValidatorFactory
25
{
26
    /**
27
     * Get a message validator set-up with all the validators.
28
     *
29
     * @return ValidateMessage
30
     */
31
    public function getMessageValidator(): ValidateMessage
32
    {
33
        $messageValidator = new ValidateMessageImplementation(
34
            [
35
                new CapitalizeTheSubjectLineValidator(),
36
                new DoNotEndTheSubjectLineWithAPeriodValidator(),
37
                new LimitTheBodyWrapLengthTo72CharactersValidator(),
38
                new LimitTheTitleLengthTo69CharactersValidator(),
39
                new SeparateSubjectFromBodyWithABlankLineValidator(),
40
                new SoftLimitTheTitleLengthTo50CharactersValidator(),
41
            ]
42
        );
43
44
        return $messageValidator;
45
    }
46
}
47