Skip to content

Commit 78518b6

Browse files
committed
fixes
1 parent e29a3bf commit 78518b6

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
@@ -141,12 +141,12 @@ private function convertMappingToArray(array $mapping): array
141141
foreach ($mapping as $m) {
142142
$converted = [
143143
'@type' => 'IriTemplateMapping',
144-
'variable' => $m->getVariable(),
145-
'property' => $m->getProperty(),
144+
'variable' => $m->variable,
145+
'property' => $m->property,
146146
];
147147

148-
if (null !== $m->isRequired()) {
149-
$converted['required'] = $m->isRequired();
148+
if (null !== ($r = $m->required)) {
149+
$converted['required'] = $r;
150150
}
151151

152152
$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)