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 |
||
24 | 4 | public function toArray(): array |
|
25 | { |
||
26 | 4 | $response = [ |
|
27 | 4 | 'type' => 'uri', |
|
28 | 4 | 'uri' => $this->uri, |
|
29 | 4 | 'namespaceParseSpec' => $this->parseSpec->toArray(), |
|
30 | 4 | ]; |
|
31 | |||
32 | 4 | if ($this->pollPeriod !== null) { |
|
33 | 4 | $response['pollPeriod'] = $this->pollPeriod; |
|
34 | } |
||
35 | |||
36 | 4 | if ($this->maxHeapPercentage !== null) { |
|
37 | 4 | $response['maxHeapPercentage'] = $this->maxHeapPercentage; |
|
38 | } |
||
39 | |||
40 | 4 | return [ |
|
41 | 4 | 'type' => 'cachedNamespace', |
|
42 | 4 | 'extractionNamespace' => $response, |
|
43 | 4 | 'injective' => $this->injective, |
|
44 | 4 | 'firstCacheTimeout' => $this->firstCacheTimeoutMs, |
|
45 | 4 | ]; |
|
47 | } |