Skip to content

Commit b42dfd1

Browse files
committed
Change normalization/denormalization signature to comply with underlying name converter signature
1 parent 7e58429 commit b42dfd1

File tree

10 files changed

+13
-18
lines changed

10 files changed

+13
-18
lines changed

src/Bridge/Doctrine/Common/Filter/BooleanFilterTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ abstract protected function getProperties(): ?array;
6565

6666
abstract protected function getLogger(): LoggerInterface;
6767

68-
abstract protected function normalizePropertyName(string $property): string;
68+
abstract protected function normalizePropertyName($property);
6969

7070
/**
7171
* Determines whether the given property refers to a boolean field.

src/Bridge/Doctrine/Common/Filter/DateFilterTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function getDescription(string $resourceClass): array
5454

5555
abstract protected function getProperties(): ?array;
5656

57-
abstract protected function normalizePropertyName(string $property): string;
57+
abstract protected function normalizePropertyName($property);
5858

5959
/**
6060
* Determines whether the given property refers to a date field.

src/Bridge/Doctrine/Common/Filter/ExistsFilterTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ abstract protected function getProperties(): ?array;
6868

6969
abstract protected function getLogger(): LoggerInterface;
7070

71-
abstract protected function normalizePropertyName(string $property): string;
71+
abstract protected function normalizePropertyName($property);
7272

7373
private function normalizeValue($value, string $property): ?bool
7474
{

src/Bridge/Doctrine/Common/Filter/NumericFilterTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ abstract protected function getProperties(): ?array;
6969

7070
abstract protected function getLogger(): LoggerInterface;
7171

72-
abstract protected function normalizePropertyName(string $property): string;
72+
abstract protected function normalizePropertyName($property);
7373

7474
/**
7575
* Determines whether the given property refers to a numeric field.

src/Bridge/Doctrine/Common/Filter/OrderFilterTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function getDescription(string $resourceClass): array
6060

6161
abstract protected function getProperties(): ?array;
6262

63-
abstract protected function normalizePropertyName(string $property): string;
63+
abstract protected function normalizePropertyName($property);
6464

6565
private function normalizeValue($value, string $property): ?string
6666
{

src/Bridge/Doctrine/Common/Filter/RangeFilterTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ abstract protected function getProperties(): ?array;
5858

5959
abstract protected function getLogger(): LoggerInterface;
6060

61-
abstract protected function normalizePropertyName(string $property): string;
61+
abstract protected function normalizePropertyName($property);
6262

6363
/**
6464
* Gets filter description.

src/Bridge/Doctrine/Common/Filter/SearchFilterTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ abstract protected function getIriConverter(): IriConverterInterface;
112112

113113
abstract protected function getPropertyAccessor(): PropertyAccessorInterface;
114114

115-
abstract protected function normalizePropertyName(string $property): string;
115+
abstract protected function normalizePropertyName($property);
116116

117117
/**
118118
* Gets the ID from an IRI or a raw ID.

src/Bridge/Doctrine/MongoDbOdm/Filter/AbstractFilter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,12 @@ protected function isPropertyEnabled(string $property, string $resourceClass): b
9191
return \array_key_exists($property, $this->properties);
9292
}
9393

94-
protected function denormalizePropertyName(string $property): string
94+
protected function denormalizePropertyName($property)
9595
{
9696
return null !== $this->nameConverter ? $this->nameConverter->denormalize($property) : $property;
9797
}
9898

99-
protected function normalizePropertyName(string $property): string
99+
protected function normalizePropertyName($property)
100100
{
101101
return null !== $this->nameConverter ? $this->nameConverter->normalize($property) : $property;
102102
}

src/Bridge/Doctrine/Orm/Filter/AbstractFilter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ protected function extractProperties(Request $request/*, string $resourceClass*/
142142
return $request->query->all();
143143
}
144144

145-
protected function denormalizePropertyName(string $property): string
145+
protected function denormalizePropertyName($property)
146146
{
147147
return null !== $this->nameConverter ? $this->nameConverter->denormalize($property) : $property;
148148
}
149149

150-
protected function normalizePropertyName(string $property): string
150+
protected function normalizePropertyName($property)
151151
{
152152
return null !== $this->nameConverter ? $this->nameConverter->normalize($property) : $property;
153153
}

src/Serializer/Filter/PropertyFilter.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,18 +157,13 @@ private function denormalizeProperties(array $properties): array
157157

158158
$result = [];
159159
foreach ($properties as $key => $value) {
160-
if (is_numeric($key)) {
161-
$result[] = $this->denormalizePropertyName($value);
162-
continue;
163-
}
164-
165-
$result[$this->denormalizePropertyName($key)] = \is_array($value) ? $this->denormalizeProperties($value) : $value;
160+
$result[$this->denormalizePropertyName($key)] = \is_array($value) ? $this->denormalizeProperties($value) : $this->denormalizePropertyName($value);
166161
}
167162

168163
return $result;
169164
}
170165

171-
private function denormalizePropertyName(string $property): string
166+
private function denormalizePropertyName($property)
172167
{
173168
return null !== $this->nameConverter ? $this->nameConverter->denormalize($property) : $property;
174169
}

0 commit comments

Comments
 (0)