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.

ParameterResolver::resolve()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 1
1
<?php
2
3
namespace Lexik\Bundle\PayboxBundle\Paybox\System\Cancellation;
4
5
use Lexik\Bundle\PayboxBundle\Paybox\AbstractParameterResolver;
6
7
/**
8
 * Class ParameterResolver
9
 *
10
 * @package Lexik\Bundle\PayboxBundle\Paybox\System\Cancellation
11
 *
12
 * @author Fabien Pomerol <[email protected]>
13
 */
14
class ParameterResolver extends AbstractParameterResolver
15
{
16
    /**
17
     * @var array
18
     */
19
    private $knownParameters = array(
20
        'VERSION',
21
        'TYPE',
22
        'SITE',
23
        'IDENTIFIANT',
24
        'MACH',
25
        'HMAC',
26
        'TIME',
27
        'ABONNEMENT',
28
        'REFERENCE',
29
    );
30
31
    /**
32
     * @var array
33
     */
34
    private $requiredParameters = array(
35
        'VERSION',
36
        'TYPE',
37
        'SITE',
38
        'IDENTIFIANT',
39
        'MACH',
40
        'HMAC',
41
        'TIME',
42
    );
43
44
    /**
45
     * {@inheritdoc}
46
     */
47
    public function resolve(array $parameters)
48
    {
49
        $this->initResolver();
50
51
        return $this->resolver->resolve($parameters);
52
    }
53
54
    /**
55
     * {@inheritdoc}
56
     */
57 View Code Duplication
    protected function initResolver()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
58
    {
59
        $this->resolver->setRequired($this->requiredParameters);
60
61
        $this->resolver->setDefined(array_diff($this->knownParameters, $this->requiredParameters));
62
63
        $this->initAllowed();
64
    }
65
66
    /**
67
     * Initialize allowed values for the cancellation OptionResolver.
68
     */
69
    protected function initAllowed()
70
    {
71
        $this->resolver
72
            ->setAllowedValues('VERSION', array('001'))
73
            ->setAllowedValues('TYPE', array('001'))
74
        ;
75
    }
76
}
77