From 08d249f2d32319b792c4ebdb523881611d05c485 Mon Sep 17 00:00:00 2001 From: Joeri Verdeyen Date: Tue, 16 Apr 2019 08:20:53 +0200 Subject: [PATCH] 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` --- src/ParamConverter/HashidsParamConverter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ParamConverter/HashidsParamConverter.php b/src/ParamConverter/HashidsParamConverter.php index b5b3d12..f43cc33 100644 --- a/src/ParamConverter/HashidsParamConverter.php +++ b/src/ParamConverter/HashidsParamConverter.php @@ -45,7 +45,7 @@ private function setHashid(Request $request, ParamConverter $configuration): voi $this->getIdentifier( $request, array_replace(['hashid' => null], $configuration->getOptions()), - $configuration->getName() + (string) $configuration->getName() ) );