Skip to content

Commit

Permalink
Support extending attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
shalvah committed Dec 12, 2023
1 parent 7263152 commit d1d74c5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/Extracting/Strategies/Responses/UseResponseAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ protected function extractFromAttributes(
$responses = [];
foreach ([...$attributesOnController, ...$attributesOnFormRequest, ...$attributesOnMethod] as $attributeInstance) {
/* @phpstan-ignore-next-line */
$responses[] = match (get_class($attributeInstance)) {
Response::class => $attributeInstance->toArray(),
ResponseFromFile::class => $attributeInstance->toArray(),
ResponseFromApiResource::class => $this->getApiResourceResponse($attributeInstance),
ResponseFromTransformer::class => $this->getTransformerResponse($attributeInstance),
$responses[] = match (true) {
$attributeInstance instanceof Response => $attributeInstance->toArray(),
$attributeInstance instanceof ResponseFromFile => $attributeInstance->toArray(),
$attributeInstance instanceof ResponseFromApiResource => $this->getApiResourceResponse($attributeInstance),
$attributeInstance instanceof ResponseFromTransformer => $this->getTransformerResponse($attributeInstance),
};
}

Expand Down
1 change: 0 additions & 1 deletion tests/GenerateDocumentation/OutputTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ public function generated_postman_collection_file_is_correct()
$generatedCollection['info']['_postman_id'] = '';
$fixtureCollection = json_decode(file_get_contents(__DIR__ . '/../Fixtures/collection.json'), true);

dump($fixtureCollection == $generatedCollection);
$this->assertEquals($fixtureCollection, $generatedCollection);
}

Expand Down

0 comments on commit d1d74c5

Please sign in to comment.