These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | namespace gossi\swagger\parts; |
||
3 | |||
4 | use phootwork\collection\Map; |
||
5 | |||
6 | trait RefPart { |
||
7 | |||
8 | /** @var string */ |
||
9 | private $ref; |
||
10 | |||
11 | /** @var boolean */ |
||
12 | private $hasRef = false; |
||
13 | |||
14 | 11 | private function parseRef(Map $data) { |
|
15 | 11 | $this->ref = $data->get('$ref'); |
|
0 ignored issues
–
show
|
|||
16 | 11 | $this->hasRef = $data->has('$ref'); |
|
17 | 11 | } |
|
18 | |||
19 | /** |
||
20 | * |
||
21 | * @return the string |
||
22 | */ |
||
23 | 1 | public function getRef() { |
|
24 | 1 | return $this->ref; |
|
25 | } |
||
26 | |||
27 | /** |
||
28 | * |
||
29 | * @param |
||
30 | * $ref |
||
31 | */ |
||
32 | 1 | public function setRef($ref) { |
|
33 | 1 | $this->ref = $ref; |
|
0 ignored issues
–
show
Equals sign not aligned with surrounding assignments; expected 4 spaces but found 1 space
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line. To visualize $a = "a";
$ab = "ab";
$abc = "abc";
will produce issues in the first and second line, while this second example $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. ![]() |
|||
34 | 1 | $this->hasRef = $ref !== null; |
|
35 | 1 | return $this; |
|
36 | } |
||
37 | |||
38 | 11 | public function hasRef() { |
|
0 ignored issues
–
show
The return type could not be reliably inferred; please add a
@return annotation.
Our type inference engine in quite powerful, but sometimes the code does not
provide enough clues to go by. In these cases we request you to add a ![]() |
|||
39 | 11 | return $this->hasRef; |
|
40 | } |
||
41 | |||
42 | |||
43 | } |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.