Skip to content

Commit

Permalink
Documenting changes
Browse files Browse the repository at this point in the history
  • Loading branch information
TecsiAron committed Mar 5, 2024
1 parent 26733fb commit 18cba3d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,13 @@ Exemplu:
```phg
<?php
use EdituraEDU\ANAF\ANAFAPIClient;
$Logger= function (string $message)
$Logger= function (string $message, ?Throwable $ex = null)
{
echo $message;
echo $message;
if($ex !== null)
{
echo $ex->getMessage();
}
};
$anaf = new ANAFAPIClient(ANAF_OAUTH,false, $Logger);
var_dump($anaf->GetEntity("RO12345678"));
Expand Down
6 changes: 5 additions & 1 deletion exemplu.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<?php
use EdituraEDU\ANAF\ANAFAPIClient;
$Logger= function (string $message)
$Logger= function (string $message, ?Throwable $ex = null)
{
echo $message;
if($ex !== null)
{
echo $ex->getMessage();
}
};
$anaf = new ANAFAPIClient(ANAF_OAUTH,false, $Logger);
var_dump($anaf->GetEntity("RO12345678"));

0 comments on commit 18cba3d

Please sign in to comment.