protected function mapRequestToArguments(\ReflectionMethod $method, Request $request)
    {
        $map = [];
        foreach ($method->getParameters() as $parameter) {
            $value = $request->getParameter(
                $parameter->getName(),
                $parameter->isDefaultValueAvailable() ? $parameter->getDefaultValue() : null
            );
            if ($parameter->getClass() &&
                $parameter->getClass()->implementsInterface(Deserializable::class)
            ) {
                /** @var Deserializable $deserializable */
                $value = $parameter->getClass()
                    ->newInstanceWithoutConstructor()
                    ->ayeAyeDeserialize($value);
                $className = $parameter->getClass()->getName();
                if (!is_object($value) || get_class($value) !== $className) {
                    throw new \RuntimeException("$className::ayeAyeDeserialize did not return an instance of itself");
                }
            }
            $map[$parameter->getName()] = $value;
        }
        return $map;
    }