Skip to content

Commit 08d249f

Browse files
jverdeyenroukmoute
authored andcommitted
Fixed getIdentifier() must be of the type string (#7)
When `$configuration->getName()` is `null`, which is possible with the default `@ParamConverter` from `FrameworkExtraBundle` an exception will be thrown because `getIdentifier` requires a string as third param. Using `?string $name` is not allowed since the bundle should be compatible with php >= 7.1 `private function getIdentifier(Request $request, $options, string $name): string`
1 parent 5cbc952 commit 08d249f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ParamConverter/HashidsParamConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ private function setHashid(Request $request, ParamConverter $configuration): voi
4545
$this->getIdentifier(
4646
$request,
4747
array_replace(['hashid' => null], $configuration->getOptions()),
48-
$configuration->getName()
48+
(string) $configuration->getName()
4949
)
5050
);
5151

0 commit comments

Comments
 (0)