Conditions | 4 |
Paths | 2 |
Total Lines | 28 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 23 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
32 | 15 | public function addParameter(string $name, string $type, mixed $value, mixed $list = null): self |
|
33 | { |
||
34 | 15 | if (!isset($this->data['parameters']) |
|
35 | 15 | || !( |
|
36 | 15 | is_array($this->data['parameters']) |
|
37 | 15 | || (is_a($this->data['parameters'], \ArrayAccess::class)) |
|
38 | 15 | ) |
|
39 | ) { |
||
40 | 15 | $this->data['parameters'] = []; |
|
|
|||
41 | } |
||
42 | |||
43 | 15 | $parameter = new Parameter( |
|
44 | 15 | $this->namespacesPaths, |
|
45 | 15 | $this->sanitizeEncoding, |
|
46 | 15 | $this->normalizerFactory, |
|
47 | 15 | ); |
|
48 | 15 | $parameter |
|
49 | 15 | ->setDirectionalVariable($this->useOneDirectionalVariables) |
|
50 | 15 | ->setResolveOptions($this->resolveOptions) |
|
51 | 15 | ->setData([ |
|
52 | 15 | 'name' => $name, |
|
53 | 15 | 'type' => $type, |
|
54 | 15 | 'value' => $value, |
|
55 | 15 | 'list' => $list, |
|
56 | 15 | ]); |
|
57 | 15 | $this->data['parameters'][] = $parameter; |
|
58 | |||
59 | 15 | return $this; |
|
60 | } |
||
62 |