Conditions | 3 |
Paths | 4 |
Total Lines | 21 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Tests | 15 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | 4 | public function toArray(): array |
|
26 | { |
||
27 | 4 | $response = [ |
|
28 | 4 | 'type' => 'uri', |
|
29 | 4 | 'uri' => $this->uri, |
|
30 | 4 | 'namespaceParseSpec' => $this->parseSpec->toArray(), |
|
31 | 4 | ]; |
|
32 | |||
33 | 4 | if ($this->pollPeriod !== null) { |
|
34 | 4 | $response['pollPeriod'] = $this->pollPeriod; |
|
35 | } |
||
36 | |||
37 | 4 | if ($this->maxHeapPercentage !== null) { |
|
38 | 4 | $response['maxHeapPercentage'] = $this->maxHeapPercentage; |
|
39 | } |
||
40 | |||
41 | 4 | return [ |
|
42 | 4 | 'type' => 'cachedNamespace', |
|
43 | 4 | 'extractionNamespace' => $response, |
|
44 | 4 | 'injective' => $this->injective, |
|
45 | 4 | 'firstCacheTimeout' => $this->firstCacheTimeoutMs, |
|
46 | 4 | ]; |
|
48 | } |