1 | <?php |
||
8 | class ProviderWrapper |
||
9 | { |
||
10 | /** |
||
11 | * @var Provider |
||
12 | */ |
||
13 | private $provider; |
||
14 | |||
15 | /** |
||
16 | * @param Provider|object $provider |
||
17 | */ |
||
18 | public function __construct(Provider $provider) |
||
22 | |||
23 | /** |
||
24 | * Proxies a call to a provider with a login check |
||
25 | * before every method if needed. |
||
26 | * |
||
27 | * @param $method |
||
28 | * @param $arguments |
||
29 | * |
||
30 | * @throws AuthException |
||
31 | * @throws InvalidRequestException |
||
32 | * |
||
33 | * @return mixed|null |
||
34 | */ |
||
35 | public function __call($method, $arguments) |
||
46 | |||
47 | /** |
||
48 | * Checks if method requires login and if true, |
||
49 | * checks logged in status. |
||
50 | * |
||
51 | * @param $method |
||
52 | * |
||
53 | * @throws AuthException if is not logged in |
||
54 | */ |
||
55 | protected function checkMethodForLoginRequired($method) |
||
65 | |||
66 | /** |
||
67 | * @param string $method |
||
68 | * @param string $message |
||
69 | * @return string |
||
70 | */ |
||
71 | protected function getErrorMethodCallMessage($method, $message) |
||
77 | } |
||
78 |