Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Pull Request — 0.9 (#692)
by
unknown
02:58
created

LengthException   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 38
ccs 10
cts 10
cp 1
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 7 1
A chooseTemplate() 0 10 3
1
<?php
2
namespace Respect\Validation\Exceptions;
3
4
class LengthException extends ValidationException
5
{
6
    const BOTH = 0;
7
    const LOWER = 1;
8
    const GREATER = 2;
9
10
    public static $defaultTemplates = array(
11
        self::MODE_DEFAULT => array(
12
            self::BOTH => '{{name}} must have a length between {{minValue}} and {{maxValue}}',
13
            self::LOWER => '{{name}} must have a length greater than {{minValue}}',
14
            self::GREATER => '{{name}} must have a length lower than {{maxValue}}',
15
        ),
16
        self::MODE_NEGATIVE => array(
17
            self::BOTH => '{{name}} must not have a length between {{minValue}} and {{maxValue}}',
18
            self::LOWER => '{{name}} must not have a length greater than {{minValue}}',
19
            self::GREATER => '{{name}} must not have a length lower than {{maxValue}}',
20
        ),
21
    );
22
23 13
    public function configure($name, array $params = array())
24
    {
25 13
        $params['minValue'] = static::stringify($params['minValue']);
26 13
        $params['maxValue'] = static::stringify($params['maxValue']);
27
28 13
        return parent::configure($name, $params);
29
    }
30
31 13
    public function chooseTemplate()
32
    {
33 13
        if (!$this->getParam('minValue')) {
34 1
            return static::GREATER;
35 12
        } elseif (!$this->getParam('maxValue')) {
36 4
            return static::LOWER;
37
        } else {
38 10
            return static::BOTH;
39
        }
40
    }
41
}
42