Skip to content

Commit

Permalink
rename method getAresRequestProvider to getAresClient
Browse files Browse the repository at this point in the history
  • Loading branch information
h4kuna committed Sep 12, 2023
1 parent 39c9693 commit 23e7f26
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github: [h4kuna]
custom: ["revolut.me/milan2m"]
custom: ["revolut.me/milan2m/czk1000/ares"]
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# Ares

[![Downloads this Month](https://img.shields.io/packagist/dm/h4kuna/ares.svg)](https://packagist.org/packages/h4kuna/ares)
[![Latest Stable Version](https://poser.pugx.org/h4kuna/ares/v/stable?format=flat)](https://packagist.org/packages/h4kuna/ares)
[![Coverage Status](https://coveralls.io/repos/github/h4kuna/ares/badge.svg?branch=master)](https://coveralls.io/github/h4kuna/ares?branch=master)
Expand All @@ -24,7 +22,7 @@ composer require h4kuna/ares

Download information about customer via his IN.

## Example
## ARES

Load data by one identification number

Expand Down
2 changes: 1 addition & 1 deletion bin/endpoints
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ foreach ($response->sources as $name => $exists) {
dump(Ares\Ares\Helper::prepareUrl($name, $IN));

try {
$result = $ares->getAresRequestProvider()->useEndpoint($name, $IN);
$result = $ares->getAresClient()->useEndpoint($name, $IN);
dump($result);
} catch (Ares\Exceptions\IdentificationNumberNotFoundException $e) {
// log identification number, why is bad? Or make nothing.
Expand Down
2 changes: 1 addition & 1 deletion bin/legal-form
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use h4kuna\Ares;
require __DIR__ . '/../vendor/autoload.php';

$ares = (new Ares\AresFactory())->create();
$result = $ares->getAresRequestProvider()->searchEndpoint(Ares\Ares\Sources::DIAL, [
$result = $ares->getAresClient()->searchEndpoint(Ares\Ares\Sources::DIAL, [
'kodCiselniku' => 'PravniForma',
'zdrojCiselniku' => 'res',
])->ciselniky[0]->polozkyCiselniku;
Expand Down
8 changes: 4 additions & 4 deletions src/Ares.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ class Ares
use MemoryStorage;

public function __construct(
private Ares\Client $aresRequestProvider,
private Ares\Client $aresClient,
private DataBox\ContentProvider $dataBoxContentProvider,
)
{
}


public function getAresRequestProvider(): Ares\Client
public function getAresClient(): Ares\Client
{
return $this->aresRequestProvider;
return $this->aresClient;
}


Expand Down Expand Up @@ -61,7 +61,7 @@ public function loadDataBox(string $in): stdClass
protected function aresContentProvider(): Ares\Core\ContentProvider
{
return $this->memoize(__METHOD__, fn (
) => new Ares\Core\ContentProvider(new Ares\Core\JsonToDataTransformer(), $this->aresRequestProvider));
) => new Ares\Core\ContentProvider(new Ares\Core\JsonToDataTransformer(), $this->aresClient));
}

}

0 comments on commit 23e7f26

Please sign in to comment.