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

Factory   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 63
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 6
c 1
b 0
f 0
lcom 0
cbo 4
dl 0
loc 63
ccs 34
cts 34
cp 1
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
namespace Respect\Validation\Rules\Locale;
3
4
use Respect\Validation\Exceptions\ComponentException;
5
use Respect\Validation\Validatable;
6
7
class Factory
8
{
9
    /**
10
     * @return Validatable
11
     */
12 3
    public function bic($countryCode)
13
    {
14 3
        $filteredCountryCode = strtoupper($countryCode);
15
        switch ($filteredCountryCode) {
16 3
            case 'DE':
17 2
                return new GermanBic();
18
19 1
            default:
20 1
                throw new ComponentException(
21 1
                    sprintf(
22 1
                        'Cannot provide BIC validation for country "%s"',
23
                        $countryCode
24 1
                    )
25 1
                );
26 1
        }
27
    }
28
29
    /**
30
     * @return Validatable
31
     */
32 3
    public function bank($countryCode)
33
    {
34 3
        $filteredCountryCode = strtoupper($countryCode);
35
        switch ($filteredCountryCode) {
36 3
            case 'DE':
37 2
                return new GermanBank();
38
39 1
            default:
40 1
                throw new ComponentException(
41 1
                    sprintf(
42 1
                        'Cannot provide bank validation for country "%s"',
43
                        $countryCode
44 1
                    )
45 1
                );
46 1
        }
47
    }
48
49
    /**
50
     * @return Validatable
51
     */
52 3
    public function bankAccount($countryCode, $bank)
53
    {
54 3
        $filteredCountryCode = strtoupper($countryCode);
55
        switch ($filteredCountryCode) {
56 3
            case 'DE':
57 2
                return new GermanBankAccount($bank);
58
59 1
            default:
60 1
                throw new ComponentException(
61 1
                    sprintf(
62 1
                        'Cannot provide bank account validation for country "%s" and bank "%s"',
63 1
                        $countryCode,
64
                        $bank
65 1
                    )
66 1
                );
67 1
        }
68
    }
69
}
70