Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ging-dev committed Jul 5, 2024
1 parent bd8c5ad commit 92aaf95
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 30 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
"email": "[email protected]"
}
],
"minimum-stability": "dev",
"minimum-stability": "stable",
"prefer-stable": true,
"require": {
"php-http/httplug": "^2.4",
"php-http/client-common": "^2.7",
"nette/utils": "^4.0",
"league/object-mapper": "dev-main"
"eventsauce/object-hydrator": "^1.4"
},
"require-dev": {
"php-http/curl-client": "^2.3",
Expand Down
33 changes: 15 additions & 18 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions src/Api/AbstractApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace IPay\Api;

use EventSauce\ObjectHydrator\DefinitionProvider;
use EventSauce\ObjectHydrator\KeyFormatterWithoutConversion;
use EventSauce\ObjectHydrator\ObjectMapper;
use EventSauce\ObjectHydrator\ObjectMapperUsingReflection;
use IPay\IPayClient;
use League\ObjectMapper\KeyFormatterWithoutConversion;
use League\ObjectMapper\ObjectMapper;
use League\ObjectMapper\ObjectMapperUsingReflection;
use League\ObjectMapper\ReflectionDefinitionProvider;
use Nette\Utils\Json;

/**
Expand All @@ -24,7 +24,7 @@ public function __construct(
private SessionInterface $session,
) {
$this->objectMapper = new ObjectMapperUsingReflection(
new ReflectionDefinitionProvider(
new DefinitionProvider(
keyFormatter: new KeyFormatterWithoutConversion(),
),
);
Expand Down
5 changes: 2 additions & 3 deletions src/Api/AuthenticatedApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function accounts(): array

/**
* @param 'Credit'|'Debit'|'' $tranType
*
* @return \Traversable<Transaction>
*/
public function historyTransactions(
Expand All @@ -42,9 +43,7 @@ public function historyTransactions(
int $pageNumber = 0,
int $maxResult = 999999999,
): \Traversable {
$parameters = get_defined_vars();

foreach ($parameters as &$value) {
foreach ($parameters = get_defined_vars() as &$value) {
if ($value instanceof \DateTimeInterface) {
$value = $value->format('Y-m-d');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace IPay\Entity;

use League\ObjectMapper\MapFrom;
use EventSauce\ObjectHydrator\MapFrom;

#[MapFrom([
'fullname' => 'name',
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace IPay\Entity;

use League\ObjectMapper\PropertyCasters\CastToType;
use EventSauce\ObjectHydrator\PropertyCasters\CastToType;

readonly class Transaction
{
Expand Down

0 comments on commit 92aaf95

Please sign in to comment.