3636 */
3737abstract class OAuthProvider implements OAuthInterface{
3838
39- /**
40- * The options instance
41- */
42- protected OAuthOptions |SettingsContainerInterface $ options ;
43-
4439 /**
4540 * The PSR-18 HTTP client
4641 */
@@ -62,50 +57,61 @@ abstract class OAuthProvider implements OAuthInterface{
6257 protected UriFactoryInterface $ uriFactory ;
6358
6459 /**
65- * A storage instance
60+ * A PSR-3 logger
6661 */
67- protected OAuthStorageInterface $ storage ;
62+ protected LoggerInterface $ logger ;
6863
6964 /**
70- * A PSR-3 logger
65+ * The options instance
7166 */
72- protected LoggerInterface $ logger ;
67+ protected OAuthOptions |SettingsContainerInterface $ options ;
68+
69+ /**
70+ * A storage instance
71+ */
72+ protected OAuthStorageInterface $ storage ;
7373
7474 /**
75- * the authorization URL
75+ * The authorization URL
7676 */
7777 protected string $ authorizationURL = '' ;
7878
7979 /**
80- * the provider's access token exchange URL
80+ * The access token exchange URL
8181 */
8282 protected string $ accessTokenURL = '' ;
8383
8484 /**
85- * an optional URL for application side token revocation
85+ * An optional URL for application side token revocation
8686 *
8787 * @see \chillerlan\OAuth\Core\TokenInvalidate
8888 */
8989 protected string $ revokeURL = '' ;
9090
9191 /**
92- * magic properties
93- *
94- * @var string[]
92+ * The API base URL
93+ */
94+ protected string $ apiURL = '' ;
95+
96+ /**
97+ * The name of the provider/class
9598 */
96- protected const MAGIC_PROPERTIES = [
97- 'apiDocs ' , 'apiURL ' , 'applicationURL ' , 'name ' , 'userRevokeURL ' ,
98- ];
99+ protected string $ name = '' ;
99100
100- /*
101- * magic properties (doc in interface docblock)
101+ /**
102+ * An optional link to the provider's API docs
102103 */
104+ protected string |null $ apiDocs = null ;
103105
104- protected string $ name = '' ;
105- protected string $ apiURL = '' ;
106- protected string | null $ apiDocs = null ;
106+ /**
107+ * An optional URL to the provider's credential registration/application page
108+ */
107109 protected string |null $ applicationURL = null ;
108- protected string |null $ userRevokeURL = null ;
110+
111+ /**
112+ * An optional link to the page where a user can revoke access tokens
113+ */
114+ protected string |null $ userRevokeURL = null ;
109115
110116 /**
111117 * OAuthProvider constructor.
@@ -141,15 +147,35 @@ protected function construct():void{
141147 }
142148
143149 /**
144- * Magic getter for the properties specified in self::ALLOWED_PROPERTIES
150+ * @inheritDoc
151+ * @codeCoverageIgnore
145152 */
146- final public function __get (string $ name ):string |null {
153+ final public function getName ():string {
154+ return $ this ->name ;
155+ }
147156
148- if (in_array ($ name , $ this ::MAGIC_PROPERTIES , true )){
149- return $ this ->{$ name };
150- }
157+ /**
158+ * @inheritDoc
159+ * @codeCoverageIgnore
160+ */
161+ final public function getApiDocURL ():string |null {
162+ return $ this ->apiDocs ;
163+ }
151164
152- return null ;
165+ /**
166+ * @inheritDoc
167+ * @codeCoverageIgnore
168+ */
169+ final public function getApplicationURL ():string |null {
170+ return $ this ->applicationURL ;
171+ }
172+
173+ /**
174+ * @inheritDoc
175+ * @codeCoverageIgnore
176+ */
177+ final public function getUserRevokeURL ():string |null {
178+ return $ this ->userRevokeURL ;
153179 }
154180
155181 /**
0 commit comments