GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

CrudValidators   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 53.85%

Importance

Changes 0
Metric Value
wmc 6
lcom 0
cbo 0
dl 0
loc 26
ccs 7
cts 13
cp 0.5385
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B validateFilterType() 0 22 6
1
<?php
2
3
namespace Petkopara\CrudGeneratorBundle\Command;
4
5
/**
6
 * Petkopara Validator functions.
7
 */
8
class CrudValidators
9
{
10
11 15
    public static function validateFilterType($filterType)
12
    {
13 15
        if (!$filterType) {
14
            throw new \RuntimeException('Please enter a filter type.');
15
        }
16
17 15
        $filterType = strtolower($filterType);
18
19 15
        if ($filterType == 1) {//set to default value
20
            $filterType = CrudGeneratorCommand::FILTER_TYPE_FORM;
21
        }
22
        // in case they typed "no", but ok with that
23 15
        if ($filterType == 'no' || $filterType == 'n') {
24
            $filterType = CrudGeneratorCommand::FILTER_TYPE_NONE;
25
        }
26
27 15
        if (!in_array($filterType, array(CrudGeneratorCommand::FILTER_TYPE_FORM, CrudGeneratorCommand::FILTER_TYPE_INPUT, CrudGeneratorCommand::FILTER_TYPE_NONE))) {
28
            throw new \RuntimeException(sprintf('Filter type is not supported "%s" is not supported.', $filterType));
29
        }
30
31 15
        return $filterType;
32
    }
33
}
34