Skip to content

Commit 70b3908

Browse files
committed
Cleaned up
1 parent d4fd88c commit 70b3908

4 files changed

Lines changed: 12 additions & 10 deletions

File tree

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ F2_API_URI=
2020
F2_API_USERNAME=
2121
F2_API_SECRET=
2222
F2_F2_USERNAME=
23+
24+
F2_API_TIME_ZONE=
2325
```
2426

2527
Run
@@ -54,8 +56,8 @@ task f2-api-client:run -- caseById 2204
5456
For development (and testing) a couple of useful tasks are defined:
5557

5658
``` text
57-
* f2-api-client:debug: Debug bin/f2-api-client inside docker compose setup, e.g. `task f2-api-client:debug -- searchCases '{"q": "test", "count": 10}'`
58-
* f2-api-client:run: Run bin/f2-api-client inside docker compose setup, e.g. `task f2-api-client:run -- searchCases '{"q": "test", "count": 10}'`
59+
* f2-api-client:run: Run bin/f2-api-client inside docker compose setup, e.g. `task f2-api-client:run -- caseSearch 'test'`
60+
* f2-api-client:debug: Debug bin/f2-api-client inside docker compose setup, e.g. `task f2-api-client:debug -- caseSearch 'test'`
5961
```
6062

6163
### F2 REST documentation

src/Client/ApiClient.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function caseSearch(string $searchTerms, int $count = 10): array
8787
return $this->createSearchResult($response);
8888
}
8989

90-
public function caseById(string $id): CaseFile
90+
public function caseById(int $id): CaseFile
9191
{
9292
$url = $this->getRequestUrl('http://cbrain.com/casefile/rel/case-by-id', [
9393
'id' => $id,
@@ -114,7 +114,7 @@ public function matterSearch(string $searchTerms, int $count = 10): array
114114
return $this->createSearchResult($response);
115115
}
116116

117-
public function matterById(string $id): Matter
117+
public function matterById(int $id): Matter
118118
{
119119
$url = $this->getRequestUrl('http://cbrain.com/casefile/rel/matter-by-id', [
120120
'id' => $id,
@@ -142,7 +142,7 @@ public function matterByMatterNumber(string $matterNumber): Matter
142142
return $this->createItemResult($response, Matter::class);
143143
}
144144

145-
public function documentById(string $id): Document
145+
public function documentById(int $id): Document
146146
{
147147
$url = $this->getRequestUrl('http://cbrain.com/casefile/rel/document-by-id', [
148148
'id' => $id,
@@ -229,7 +229,7 @@ protected function configureOptions(OptionsResolver $resolver): void
229229
->setAllowedTypes('cache_item_pool', CacheItemPoolInterface::class);
230230
}
231231

232-
protected function getRequestUrl(string $rel, array $values): string
232+
protected function getRequestUrl(string $rel, array $values = []): string
233233
{
234234
$index = $this->getServiceIndex();
235235

src/Command/F2ApiClientCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ public function __invoke(
3434
$response = match ($action) {
3535
'getServiceIndex' => $client->getServiceIndex(),
3636
'caseSearch' => $client->caseSearch((string) $arg),
37-
'caseById' => $client->caseById((string) $arg),
37+
'caseById' => $client->caseById((int) $arg),
3838
'matterSearch' => $client->matterSearch((string) $arg),
39-
'matterById' => $client->matterById((string) $arg),
39+
'matterById' => $client->matterById((int) $arg),
4040
'matterByMatterNumber' => $client->matterByMatterNumber((string) $arg),
41-
'documentById' => $client->documentById((string) $arg),
41+
'documentById' => $client->documentById((int) $arg),
4242
default => throw new InvalidArgumentException(sprintf('Invalid action: %s', $action)),
4343
};
4444

src/Model/F2Item.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use ItkDev\F2ApiClient\Model\F2Item\Links;
88

9-
abstract class F2Item extends AbstractItem
9+
abstract class F2Item extends AbstractItem implements \Stringable
1010
{
1111
public ?int $id = null;
1212
public ?Links $links = null;

0 commit comments

Comments
 (0)