Total Complexity | 2 |
Total Lines | 53 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | abstract class Resource |
||
9 | { |
||
10 | /** |
||
11 | * @var Output |
||
12 | */ |
||
13 | protected $output; |
||
14 | |||
15 | /** |
||
16 | * @var Identifier |
||
17 | */ |
||
18 | protected $identifier; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $url; |
||
24 | |||
25 | /** |
||
26 | * Resource constructor. |
||
27 | * |
||
28 | * @param Identifier $identifier |
||
29 | * @param Output $output |
||
30 | */ |
||
31 | public function __construct(Identifier $identifier, Output $output) |
||
35 | } |
||
36 | |||
37 | /** |
||
38 | * Full URL to the fetched resource. |
||
39 | * |
||
40 | * @return string |
||
41 | */ |
||
42 | public function getApiUrl(): string |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * Request Options Array used to fetch the resource. |
||
49 | * |
||
50 | * @return array |
||
51 | */ |
||
52 | abstract public function getRequestOptions(): array; |
||
53 | |||
54 | /** |
||
55 | * Transform raw data to a usable format. |
||
56 | * |
||
57 | * @param string $document |
||
58 | * @return array |
||
59 | */ |
||
60 | abstract public function getDataFrom(string $document): array; |
||
61 | } |
||
62 |