Skip to content

Commit d11767f

Browse files
committed
fixes
1 parent c27784c commit d11767f

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/Hydra/Serializer/CollectionFiltersNormalizer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,12 +144,12 @@ private function convertMappingToArray(array $mapping): array
144144
foreach ($mapping as $m) {
145145
$converted = [
146146
'@type' => 'IriTemplateMapping',
147-
'variable' => $m->getVariable(),
148-
'property' => $m->getProperty(),
147+
'variable' => $m->variable,
148+
'property' => $m->property,
149149
];
150150

151-
if (null !== $m->isRequired()) {
152-
$converted['required'] = $m->isRequired();
151+
if (null !== ($r = $m->required)) {
152+
$converted['required'] = $r;
153153
}
154154

155155
$convertedMapping[] = $converted;

src/Hydra/State/Util/SearchHelperTrait.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,16 @@ private function getSearchMappingAndKeys(?Operation $operation = null, ?string $
6666
$filterDescription = $filter->getDescription($resourceClass);
6767

6868
foreach ($filterDescription as $variable => $description) {
69+
// // This is a practice induced by PHP and is not necessary when implementing URI template
6970
if (str_ends_with((string) $variable, '[]')) {
7071
continue;
7172
}
7273

73-
if (($prop = $parameter->getProperty()) && ($description['property'] ?? null) !== $prop) {
74+
if (!($descriptionProperty = $description['property'] ?? null)) {
75+
continue;
76+
}
77+
78+
if (($prop = $parameter->getProperty()) && $descriptionProperty !== $prop) {
7479
continue;
7580
}
7681

0 commit comments

Comments
 (0)