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.
Passed
Push — master ( 9050e5...dbe7d3 )
by
unknown
02:26
created

CreateAliasResponse::isValid()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 8
Ratio 100 %

Code Coverage

Tests 3
CRAP Score 2.0625

Importance

Changes 0
Metric Value
dl 8
loc 8
ccs 3
cts 4
cp 0.75
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2.0625
1
<?php
2
/*
3
 * This file is part of the Marlon Ogone package.
4
 *
5
 * (c) Marlon BVBA <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace Ogone\DirectLink;
12
13
use Ogone\AbstractResponse;
14
use Ogone\ShaComposer\ShaComposer;
15
16
class CreateAliasResponse extends AbstractResponse
17
{
18
19
    const STATUS_OK = 0;
20
    const STATUS_NOK = 1;
21
    const STATUS_UPDATED = 2;
22
23
    /**
24
     * Checks if the response is valid
25
     * @return bool
26
     */
27 1 View Code Duplication
    public function isValid(ShaComposer $shaComposer)
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...
28
    {
29 1
        if (function_exists('hash_equals')) {
30 1
            return hash_equals($shaComposer->compose($this->parameters), $this->shaSign);
31
        } else {
32
            return $shaComposer->compose($this->parameters) == $this->shaSign;
33
        }
34
    }
35
36 1
    public function isSuccessful()
37
    {
38 1
        return in_array($this->getParam('STATUS'), array(self::STATUS_OK, self::STATUS_UPDATED));
39
    }
40
41 1
    public function getAlias()
42
    {
43 1
        return new Alias($this->parameters['ALIAS'], $this->parameters['CN'], $this->parameters['CARDNO'], $this->parameters['ED']);
44
    }
45
}
46