1 | <?php |
||
43 | class OpenPlatform |
||
44 | { |
||
45 | /** |
||
46 | * Server guard. |
||
47 | * |
||
48 | * @var Guard |
||
49 | */ |
||
50 | protected $server; |
||
51 | |||
52 | /** |
||
53 | * OpenPlatform component access token. |
||
54 | * |
||
55 | * @var AccessToken |
||
56 | */ |
||
57 | protected $access_token; |
||
58 | |||
59 | /** |
||
60 | * OpenPlatform config. |
||
61 | * |
||
62 | * @var array |
||
63 | */ |
||
64 | protected $config; |
||
65 | |||
66 | /** |
||
67 | * Container in the scope of the open platform. |
||
68 | * |
||
69 | * @var Container |
||
70 | */ |
||
71 | protected $container; |
||
72 | |||
73 | /** |
||
74 | * Components. |
||
75 | * |
||
76 | * @var array |
||
77 | */ |
||
78 | private $components = [ |
||
79 | 'pre_auth' => Components\PreAuthCode::class, |
||
80 | 'authorizer' => Components\Authorizer::class, |
||
81 | ]; |
||
82 | |||
83 | /** |
||
84 | * OpenPlatform constructor. |
||
85 | * |
||
86 | * @param Guard $server |
||
87 | * @param $access_token |
||
88 | * @param array $config |
||
89 | */ |
||
90 | 1 | public function __construct(Guard $server, $access_token, $config) |
|
96 | |||
97 | /** |
||
98 | * Sets the container for use of the platform. |
||
99 | * |
||
100 | * @param Container $container |
||
101 | */ |
||
102 | 1 | public function setContainer(Container $container) |
|
106 | |||
107 | /** |
||
108 | * Magic get access. |
||
109 | * |
||
110 | * @param $name |
||
111 | * |
||
112 | * @return mixed |
||
113 | * |
||
114 | * @throws \Exception |
||
115 | */ |
||
116 | 1 | public function __get($name) |
|
132 | } |
||
133 |