Skip to content

Commit c589239

Browse files
committed
fix type in all and getById methods
1 parent d657814 commit c589239

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/Resources/Documents.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
abstract class Documents extends Resource
88
{
99
protected DocumentType $type;
10+
1011
public function all(array $params = []): array
1112
{
1213
$params['type'] = $this->type->value;
1314

1415
return parent::all($params);
1516
}
17+
1618
public static function availableLanguages(): array
1719
{
1820
return ['it', 'en', 'de', 'fr', 'es', 'el', 'pl', 'sl'];

src/Resources/IssuedDocuments.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ abstract class IssuedDocuments extends Documents
88
{
99
protected string $path = 'issued_documents';
1010

11-
public function getByNumber(int $number, int $year): array
11+
public function getByNumber(int $number, int $year): ?array
1212
{
1313
$params['filter'] = [
1414
[
@@ -28,7 +28,7 @@ public function getByNumber(int $number, int $year): array
2828
],
2929
];
3030

31-
return $this->all($params);
31+
return $this->all($params)[0] ?? null;
3232
}
3333

3434
public function sendToSDI(int $id, array $data = ['data' => []]): array

0 commit comments

Comments
 (0)