| Total Complexity | 5 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class CrossrefUpdates extends Extractor implements ProvidesUpdatesData |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @throws UnparseableApiException |
||
| 12 | */ |
||
| 13 | protected function fillSearchTree(): void |
||
| 14 | { |
||
| 15 | if ('ok' !== $this->document['status']) { |
||
| 16 | throw new UnparseableApiException(); |
||
| 17 | } |
||
| 18 | |||
| 19 | if (empty($this->document['message']['items'])) { |
||
| 20 | throw new UnparseableApiException(); |
||
| 21 | } |
||
| 22 | |||
| 23 | $this->searchTree = $this->document['message']['items'][0]; |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Extract and format data needed for the Updates Relationship |
||
| 28 | * on the Publication Model. |
||
| 29 | */ |
||
| 30 | public function extractUpdatesData(): void |
||
| 39 | ]; |
||
| 40 | } |
||
| 43 |