1 | <?php |
||
11 | abstract class AbstractBattleNetAuth |
||
12 | { |
||
13 | use BattleNetTrait; |
||
14 | |||
15 | protected $_apiSecret; |
||
16 | protected $_redirectUrl; |
||
17 | protected $_scopes; |
||
18 | |||
19 | /** |
||
20 | * @param string $apiKey |
||
21 | * @param string $apiSecret |
||
22 | * @param string $redirectUrl |
||
23 | * @param string[] $scopes |
||
24 | * @param string $serverLocation |
||
25 | * @param string $responseLocale |
||
26 | */ |
||
27 | public function __construct( |
||
39 | |||
40 | /** |
||
41 | * @return string |
||
42 | */ |
||
43 | private function _getScopes() |
||
52 | |||
53 | /** |
||
54 | * @param string|null $state |
||
55 | * @param bool $redirect |
||
56 | * |
||
57 | * @return string[] |
||
58 | */ |
||
59 | public function getCode($state = null, $redirect = false) |
||
85 | |||
86 | /** |
||
87 | * Each code can only be used once |
||
88 | * |
||
89 | * @param string $code |
||
90 | * |
||
91 | * @return array |
||
92 | * |
||
93 | * @throws CurlException |
||
94 | * @throws CurlInvalidJsonException |
||
95 | */ |
||
96 | public function getAccessToken($code) |
||
112 | |||
113 | /** |
||
114 | * @param string $path |
||
115 | * @param string $accessToken |
||
116 | * |
||
117 | * @return array |
||
118 | * @throws BattleNetException |
||
119 | */ |
||
120 | protected function _get($path, $accessToken) |
||
135 | } |
||
136 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: