From 18cba3dde1289356fac9c6a61036008a14c4c3c3 Mon Sep 17 00:00:00 2001 From: Aron Date: Tue, 5 Mar 2024 12:19:06 +0200 Subject: [PATCH] Documenting changes --- CHANGELOG.md | 19 +++++++++++++++++++ README.md | 8 ++++++-- exemplu.php | 6 +++++- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c662f83..1faacf8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,22 @@ +# v1.1.0-alpha +- LoadAccessToken() no longer causes unhandled exception when file does not exist. +- Location of the token file is now configurable. (Check $TokenFilePath and ANAFAPIClient::__construct()) +- Moved token load/refresh logic from HasAccessToken() to LoadAccessToken() and RefreshAccessToken(). +- Added optional parameter to LoadAccessToken() to enable/disable automatic token refresh. +- HasAccessToken() now calls LoadAccessToken() with automatic refresh enabled. (logic moved) +- The error callback method now has a second, optional, parameter: ?Throwable $ex = null. +- Removed some unnecessary error_log calls. +- General code cleanup. + +BREAKING CHANGES: +================= +- HasToken() renamed to HasAccessToken(). (for consistency) +- GetAccessToken() no longer has a parameter and serves as a getter for $AccessToken instead of loading the token from ANAF. Functionality as it was moved to a new method (ProcessOAuthCallback). +- RefreshToken() renamed to RefreshAccessToken(). (for consistency) +- SaveAccessToken() is now private (called automatically by ProcessOAuthCallback and RefreshAccessToken). +- UploadEFactura() added a new (required) parameter: $sellerCIF (previously the CIF was hardcoded) + + # v1.0.4-alpha Added timeout to all outgoing requests (5s by default) diff --git a/README.md b/README.md index e3ad8d2..19cb88c 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,13 @@ Exemplu: ```phg getMessage(); + } }; $anaf = new ANAFAPIClient(ANAF_OAUTH,false, $Logger); var_dump($anaf->GetEntity("RO12345678")); diff --git a/exemplu.php b/exemplu.php index d83d5f5..b3a1df1 100644 --- a/exemplu.php +++ b/exemplu.php @@ -1,8 +1,12 @@ getMessage(); + } }; $anaf = new ANAFAPIClient(ANAF_OAUTH,false, $Logger); var_dump($anaf->GetEntity("RO12345678")); \ No newline at end of file