1 | <?php |
||
24 | abstract class AbstractResource implements ResourceInterface |
||
25 | { |
||
26 | use Properties; |
||
27 | |||
28 | /** |
||
29 | * @var Client |
||
30 | */ |
||
31 | private $client; |
||
32 | |||
33 | /** |
||
34 | * @var array |
||
35 | */ |
||
36 | private static $currentUserId = []; |
||
37 | |||
38 | /** |
||
39 | * @var AdapterInterface|null |
||
40 | */ |
||
41 | private $adapter; |
||
42 | |||
43 | /** |
||
44 | * AbstractResource constructor. |
||
45 | * @param Client $client |
||
46 | */ |
||
47 | public function __construct(Client $client) |
||
51 | |||
52 | /** |
||
53 | * @return array |
||
54 | * @throws \InvalidArgumentException |
||
55 | */ |
||
56 | protected function currentUser(): array |
||
71 | |||
72 | /** |
||
73 | * @return string |
||
74 | * @throws \InvalidArgumentException |
||
75 | */ |
||
76 | protected function currentUserId(): string |
||
80 | |||
81 | /** |
||
82 | * @return $this |
||
83 | * @throws \InvalidArgumentException |
||
84 | */ |
||
85 | protected function getSync() |
||
91 | |||
92 | /** |
||
93 | * @return $this |
||
94 | * @throws \InvalidArgumentException |
||
95 | */ |
||
96 | protected function getAsync() |
||
102 | |||
103 | /** |
||
104 | * @return $this |
||
105 | * @throws \InvalidArgumentException |
||
106 | */ |
||
107 | protected function getStream() |
||
113 | |||
114 | /** |
||
115 | * @param Route $route |
||
116 | * @return mixed |
||
117 | */ |
||
118 | protected function fetch(Route $route) |
||
132 | |||
133 | /** |
||
134 | * @param string $type |
||
135 | * @return AdapterInterface |
||
136 | * @throws \InvalidArgumentException |
||
137 | */ |
||
138 | protected function using(string $type) |
||
142 | |||
143 | /** |
||
144 | * @return AdapterInterface |
||
145 | */ |
||
146 | private function resetAdapter(): AdapterInterface |
||
156 | } |