Total Complexity | 5 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
7 | class PubmedWebsite implements Resource |
||
8 | { |
||
9 | protected $url = 'https://www.ncbi.nlm.nih.gov/pubmed/'; |
||
10 | |||
11 | protected $queryStringParameters = [ |
||
12 | 'query' => [ |
||
13 | 'term' => '', |
||
14 | ], |
||
15 | ]; |
||
16 | |||
17 | protected $input; |
||
18 | |||
19 | protected $identifier; |
||
20 | |||
21 | public function __construct(Identifier $identifier) |
||
22 | { |
||
23 | $this->queryStringParameters['query']['term'] = $identifier->getQueryString(); |
||
24 | } |
||
25 | |||
26 | /** |
||
27 | * @return string |
||
28 | */ |
||
29 | public function getApiUrl(): string |
||
30 | { |
||
31 | return $this->url; |
||
32 | } |
||
33 | |||
34 | /** |
||
35 | * @return array |
||
36 | */ |
||
37 | public function getRequestOptions(): array |
||
38 | { |
||
39 | return $this->queryStringParameters; |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * @param string $document |
||
44 | * |
||
45 | * @return array |
||
46 | */ |
||
47 | public function getDataFrom(string $document): array |
||
55 | } |
||
56 | } |
||
57 | } |
||
58 |