Skip to content

Commit 3d82161

Browse files
committed
Update Payload URIs and improve type annotation
- Modified Payload creation URIs to reflect updated API paths (`v9` changes). - Refined PHPDoc annotations for better type coverage. - Added pest-plugin-type-coverage to composer dev dependencies.
1 parent 6ea2d47 commit 3d82161

4 files changed

Lines changed: 9 additions & 9 deletions

File tree

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"mockery/mockery": "^1.6",
2323
"nunomaduro/collision": "^8.0.0",
2424
"pestphp/pest": "^3.80.0",
25+
"pestphp/pest-plugin-type-coverage": "^3.6",
2526
"phpstan/phpstan": "^2.1",
2627
"rector/rector": "^2.1.0",
2728
"symfony/var-dumper": "^6.2.2"

src/Responses/BalanceSheet/CreateResponse.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Anaf\Enums\BalanceSheet\BL;
99
use Anaf\Enums\BalanceSheet\OL;
1010
use Anaf\Responses\Concerns\ArrayAccessible;
11-
use BackedEnum;
1211

1312
/**
1413
* @implements Response<array{year: int, tax_identification_number: int, company_name: string, activity_code: int, activity_name: string, indicators: array<string, array{indicator: string, value: int, indicator_name: string}>}>
@@ -44,7 +43,7 @@ public static function from(array $attributes): self
4443
* @see https://static.anaf.ro/static/10/Anaf/Declaratii_R/AplicatiiDec/UniversalCode_2012.pdf for indicators type
4544
*/
4645

47-
/** @var BackedEnum $indicatorType */
46+
/** @var class-string<BL|OL> $indicatorType */
4847
$indicatorType = match ($attributes['i'][0]['val_den_indicator']) {
4948
'Efectivul de personal privind activitatile economice' => OL::class,
5049
default => BL::class,

tests/Transporters/HttpTransporterObject.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
});
2626

2727
test('request object', function () {
28-
$payload = Payload::create('PlatitorTvaRest/api/v8/ws/tva', []);
28+
$payload = Payload::create('api/PlatitorTvaRest/v9/tva', []);
2929

3030
$response = new Response(200, [], json_encode([
3131
'asdf',
@@ -39,7 +39,7 @@
3939
->and($request->getUri())
4040
->getHost()->toBe('webservicesp.anaf.ro')
4141
->getScheme()->toBe('https')
42-
->getPath()->toBe('/PlatitorTvaRest/api/v8/ws/tva');
42+
->getPath()->toBe('/api/PlatitorTvaRest/v9/tva');
4343

4444
return true;
4545
})->andReturn($response);
@@ -71,7 +71,7 @@
7171
});
7272

7373
test('request object response', function () {
74-
$payload = Payload::create('PlatitorTvaRest/api/v8/ws/tva', []);
74+
$payload = Payload::create('api/PlatitorTvaRest/v9/tva', []);
7575

7676
$response = new Response(200, [], json_encode(
7777
[
@@ -112,7 +112,7 @@
112112
});
113113

114114
test('request object client errors', function () {
115-
$payload = Payload::create('PlatitorTvaRest/api/v8/ws/tva', []);
115+
$payload = Payload::create('api/PlatitorTvaRest/v9/tva', []);
116116

117117
$baseUri = BaseUri::from('webservicesp.anaf.ro');
118118
$headers = Headers::create()->withContentType(ContentType::JSON);
@@ -131,7 +131,7 @@
131131
});
132132

133133
test('request object serialization errors', function () {
134-
$payload = Payload::create('PlatitorTvaRest/api/v8/ws/tva', []);
134+
$payload = Payload::create('api/PlatitorTvaRest/v9/tva', []);
135135

136136
$response = new Response(200, [], 'err');
137137

tests/ValueObjects/Transporter/Payload.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use Anaf\ValueObjects\Transporter\QueryParams;
88

99
it('has a post method', function () {
10-
$payload = Payload::create('PlatitorTvaRest/api/v8/ws/tva', []);
10+
$payload = Payload::create('api/PlatitorTvaRest/v9/tva', []);
1111

1212
$baseUri = BaseUri::from('webservicesp.anaf.ro');
1313
$headers = Headers::create()->withContentType(ContentType::JSON);
@@ -56,7 +56,7 @@
5656
});
5757

5858
test('post verb has a body', function () {
59-
$payload = Payload::create('PlatitorTvaRest/api/v8/ws/tva', [
59+
$payload = Payload::create('api/PlatitorTvaRest/v9/tva', [
6060
[
6161
'cui' => '3874563',
6262
'data' => '2023-01-01',

0 commit comments

Comments
 (0)