Replies: 3 comments 2 replies
-
@Kurounin First off thank you for you contributions and courtosey!
Implementing these changes would also require a change to SendANAFRequest, as it currently relies on calling HasToken to load the token when needed.
Calling LoadAccessToken from the constructor would cause an extra outgoing request when it might not be necessary, not all outgoing request require a token. Given that the ANAF API apears to go up and down more than a rollercoaster, sometimes partially, I'd rather not have any requests that are not necessary, especaly not on initialization. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick response. Calling the
|
Beta Was this translation helpful? Give feedback.
-
Just pushed a commit that integrates some of the changes you suggested, feel free to create a PR with any further changes you'd find useful. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
Thanks for the work on this library so far. I was thinking of refactoring the loading of the token logic, but wanted to run it by you first. What do you think of:
LoadAccessToken
private and calling it from the constructorHasToken
toLoadAccessToken
AccessToken
in theLoadAccessToken
and theSaveAccessToken
HasToken
just check ifAccessToken
is not nullSaveAccessToken
private and call it also fromGetAccessToken
$authCode
optional forGetAccessToken
in which case it would just return the currentAccessToken
Beta Was this translation helpful? Give feedback.
All reactions