Skip to content

Commit

Permalink
QC fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pkly committed Mar 5, 2024
1 parent 251f203 commit 7bdf2f5
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Service/Nelmio/DtoOADescriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private function describeDTO(
$name = explode('.', $key)[0];

$operation->parameters[] = new Parameter([
'name' => $name . ($type === 'query' && $model->isCollection() ? '[]' : ''), // if we're in the query bag automatically add [] to param name
'name' => $name.($type === 'query' && $model->isCollection() ? '[]' : ''), // if we're in the query bag automatically add [] to param name
'in' => self::OA_BAG_MAP[$type] ?? $type,
'schema' => $schema,
'description' => $model->getDescription() ?? $this->getUndefined(),
Expand Down
1 change: 1 addition & 0 deletions src/Traits/Type/CoercerResultTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ private function buildResult(
]),
];
}

if ($validatePropertyConstraints) {
$constraints = array_merge($constraints, $property->getConstraints());
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixtures/Model/Dto/ValidationContext/SubDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ class SubDto extends AbstractDto
{
#[Assert\NotBlank]
public string|null $value = null;
}
}
2 changes: 1 addition & 1 deletion tests/Traits/Unit/ConstraintValidationTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ protected function assertConstraintList(
array $constraints = []
): void {
$this->assertCount($count, $list);

$counter = 0;

foreach ($constraints as $property => $message) {
$violation = $list->get($counter++);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function testPartialSuccess(): void
'intVal' => 'This value should be greater than or equal to 15.',
'dto[0]' => 'Value must not be null',
'dto[0].something' => 'Subpathed value',
'dto[0].value' => 'This value should not be blank.'
'dto[0].value' => 'This value should not be blank.',
]
);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Dto/ValidationContext/MappedToTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Symfony\Component\HttpFoundation\Request;

/**
* This tests checks if the validation is being performed as expected on Symfony objects
* This tests checks if the validation is being performed as expected on Symfony objects.
*
* @group new-validation
*/
Expand Down

0 comments on commit 7bdf2f5

Please sign in to comment.