Skip to content

Commit

Permalink
unify syntax in readmes (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
petrparolek committed Mar 12, 2021
1 parent dbc4d3b commit 18160a4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
36 changes: 18 additions & 18 deletions .docs/README.md
Expand Up @@ -6,33 +6,33 @@

- [Setup](#setup)
- [Usage](#usage)
- [Rootquestor](#rootquestor)
- [Requestors](#requestors)
- [Client](#client)
- [Rootquestor](#rootquestor)
- [Requestors](#requestors)
- [Client](#client)

## Setup

Require package

```sh
```bash
composer require contributte/czech-post
```

Configure extension

```yaml
```neon
extensions:
contributte.czechpost: Contributte\CzechPost\DI\CzechPostExtension
contributte.czechpost: Contributte\CzechPost\DI\CzechPostExtension
contributte.czechpost:
http:
base_uri: https://online3.postservis.cz/dopisonline/
auth: [dreplech, dreplech]
config:
tmp_dir: '../../some/tmp/dir/path/'
http:
base_uri: https://online3.postservis.cz/dopisonline/
auth: [dreplech, dreplech]
config:
tmp_dir: '../../some/tmp/dir/path/'
```

Note: dreplech/dreplech are CzechPost testing credentials.
Note: dreplech/dreplech are CzechPost testing credentials.

## Usage

Expand All @@ -44,13 +44,13 @@ For better usage explanation please see `tests/Cases/UsageTest.php`

In order to create the consignment you must instantiate `Consignment` entity.
By passing this entity object to `sendConsignment` method you should get `Dispatch` entity as the response.
Among others `Dispatch` has `getId()` and `getTrackingNumber()` methods,
Among others `Dispatch` has `getId()` and `getTrackingNumber()` methods,
which should be used for calling `getConsignmentsOverview` and `getConsignmentLabel` methods.

### Errors

In case of invalid request the `RequestException` is being thrown.
When there is some problem with getting response or unexpected response data format, the `ResponseException` is thrown.
When there is some problem with getting response or unexpected response data format, the `ResponseException` is thrown.

### Rootquestor

Expand All @@ -62,8 +62,8 @@ public $cpost;

public function magic(): void
{
$this->cpost->consignment->sendConsignment($consignment);
$this->cpost->history->status('RRXXYYZZ');
$this->cpost->consignment->sendConsignment($consignment);
$this->cpost->history->status('RRXXYYZZ');
}
```

Expand All @@ -84,7 +84,7 @@ public $parcelHistoryRequestor;
**ConsignmentRequestor**

| Method | API path | Type |
| -------------------------------------------| ----------------------|----- |
|--------------------------------------------|-----------------------|----- |
| send(Consignment $consignment): Dispatch | .../donApi.php | POST |
| detail(string $id): Dispatch | .../donPrehledZak.php | POST |
| findByDate(DateTime $date): Dispatch[] | .../donPrehledZak.php | POST |
Expand Down Expand Up @@ -120,6 +120,6 @@ public $cpostClient;

public function magic(): void
{
$client = $this->cpostClient->get('unprefixed/url/to/resource');
$client = $this->cpostClient->get('unprefixed/url/to/resource');
}
```
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -22,7 +22,7 @@

To install latest version of `contributte/czech-post` use [Composer](https://getcomposer.com).

```
```bash
composer require contributte/czech-post
```

Expand Down

0 comments on commit 18160a4

Please sign in to comment.