From db379bd929ee24d3e20c27ca184d73467a693cc8 Mon Sep 17 00:00:00 2001 From: codepluswander <122572177+codepluswander@users.noreply.github.com> Date: Sun, 12 Mar 2023 19:16:47 +0100 Subject: [PATCH] Add variadic param name (#108) --- src/M6Web/Component/RedisMock/RedisMockFactory.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/M6Web/Component/RedisMock/RedisMockFactory.php b/src/M6Web/Component/RedisMock/RedisMockFactory.php index 09578fe..b8b2ea1 100644 --- a/src/M6Web/Component/RedisMock/RedisMockFactory.php +++ b/src/M6Web/Component/RedisMock/RedisMockFactory.php @@ -319,7 +319,12 @@ protected function getMethodSignature(\ReflectionMethod $method) $signature .= '&'; } // paramName - $signature .= '$' . $parameter->getName(); + $paramName = '$' . $parameter->getName(); + // variadic + if ($parameter->isVariadic()) { + $paramName = '...' . $paramName; + } + $signature .= $paramName; // defaultValue if ($parameter->isDefaultValueAvailable()) { $signature .= ' = ';