Skip to content

Commit a24c5ea

Browse files
committed
fix
1 parent 597ea4d commit a24c5ea

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/Metadata/Resource/Factory/ParameterResourceMetadataCollectionFactory.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
use ApiPlatform\Metadata\Exception\RuntimeException;
1919
use ApiPlatform\Metadata\FilterInterface;
2020
use ApiPlatform\Metadata\JsonSchemaFilterInterface;
21-
use ApiPlatform\Metadata\Metadata;
2221
use ApiPlatform\Metadata\OpenApiParameterFilterInterface;
2322
use ApiPlatform\Metadata\Operation;
2423
use ApiPlatform\Metadata\Parameter;
@@ -476,7 +475,12 @@ private function createParametersFromAttributes(Operation $operation): Parameter
476475
{
477476
$parameters = new Parameters();
478477

479-
$reflectionClass = new \ReflectionClass($operation->getClass());
478+
$resourceClass = $operation->getClass();
479+
if (null === $resourceClass) {
480+
return $parameters;
481+
}
482+
483+
$reflectionClass = new \ReflectionClass($resourceClass);
480484

481485
foreach ($reflectionClass->getProperties() as $reflectionProperty) {
482486
foreach ($reflectionProperty->getAttributes(Parameter::class, \ReflectionAttribute::IS_INSTANCEOF) as $attribute) {

tests/Functional/Parameters/ParameterOnPropertiesTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ public function testQueryParameterOnProperty(): void
5757
$this->assertSame('qoox', $members[1]['name']);
5858
}
5959

60-
/**
61-
* @throws \Throwable
62-
* @throws MongoDBException
63-
*/
6460
private function loadFixtures(): void
6561
{
6662
$manager = $this->getManager();

0 commit comments

Comments
 (0)