MissingParams::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 0
cts 6
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
/*
4
 * Copyright 2014 Brian Smith <[email protected]>.
5
 *
6
 * Licensed under the Apache License, Version 2.0 (the "License");
7
 * you may not use this file except in compliance with the License.
8
 * You may obtain a copy of the License at
9
 *
10
 *      http://www.apache.org/licenses/LICENSE-2.0
11
 *
12
 * Unless required by applicable law or agreed to in writing, software
13
 * distributed under the License is distributed on an "AS IS" BASIS,
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
 * See the License for the specific language governing permissions and
16
 * limitations under the License.
17
 */
18
19
namespace phparia\Resources;
20
21
/**
22
 * Error event sent when required params are missing.
23
 *
24
 * @author Brian Smith <[email protected]>
25
 */
26
class MissingParams extends Response
27
{
28
    /**
29
     * @var string Indicates the type of this message.
30
     */
31
    private $type;
32
33
    /**
34
     * @var array A list of the missing parameters
35
     */
36
    private $params;
37
38
    /**
39
     * @return string Indicates the type of this message.
40
     */
41
    public function getType()
42
    {
43
        return $this->type;
44
    }
45
46
    /**
47
     * @return array A list of the missing parameters
48
     */
49
    public function getParams()
50
    {
51
        return $this->params;
52
    }
53
54
    /**
55
     * @param string $response
56
     */
57
    public function __construct($response)
58
    {
59
        parent::__construct($response);
60
61
        $this->type = $this->getResponseValue('type');
62
        $this->params = $this->getResponseValue('params');
0 ignored issues
show
Documentation Bug introduced by
It seems like $this->getResponseValue('params') of type * is incompatible with the declared type array of property $params.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
63
    }
64
}
65