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
Push — 1.0 ( 145725...d072b4 )
by Henrique
03:07
created

Factory   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 4
dl 0
loc 63
c 0
b 0
f 0
ccs 0
cts 46
cp 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A bic() 0 16 2
A bank() 0 16 2
A bankAccount() 0 17 2
1
<?php
2
3
/*
4
 * This file is part of Respect/Validation.
5
 *
6
 * (c) Alexandre Gomes Gaigalas <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the "LICENSE.md"
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Respect\Validation\Rules\Locale;
13
14
use Respect\Validation\Exceptions\ComponentException;
15
use Respect\Validation\Validatable;
16
17
class Factory
18
{
19
    /**
20
     * @return Validatable
21
     */
22
    public function bic($countryCode)
23
    {
24
        $filteredCountryCode = strtoupper($countryCode);
25
        switch ($filteredCountryCode) {
26
            case 'DE':
27
                return new GermanBic();
28
29
            default:
30
                throw new ComponentException(
31
                    sprintf(
32
                        'Cannot provide BIC validation for country "%s"',
33
                        $countryCode
34
                    )
35
                );
36
        }
37
    }
38
39
    /**
40
     * @return Validatable
41
     */
42
    public function bank($countryCode)
43
    {
44
        $filteredCountryCode = strtoupper($countryCode);
45
        switch ($filteredCountryCode) {
46
            case 'DE':
47
                return new GermanBank();
48
49
            default:
50
                throw new ComponentException(
51
                    sprintf(
52
                        'Cannot provide bank validation for country "%s"',
53
                        $countryCode
54
                    )
55
                );
56
        }
57
    }
58
59
    /**
60
     * @return Validatable
61
     */
62
    public function bankAccount($countryCode, $bank)
63
    {
64
        $filteredCountryCode = strtoupper($countryCode);
65
        switch ($filteredCountryCode) {
66
            case 'DE':
67
                return new GermanBankAccount($bank);
68
69
            default:
70
                throw new ComponentException(
71
                    sprintf(
72
                        'Cannot provide bank account validation for country "%s" and bank "%s"',
73
                        $countryCode,
74
                        $bank
75
                    )
76
                );
77
        }
78
    }
79
}
80