private static function actionMethodMatchesParameters(\ReflectionMethod $reflectionMethod, array $parameters): bool
    {
        $parametersCount = count($parameters);

        if ($reflectionMethod->getNumberOfParameters() < $parametersCount) {
            return false;
        }

        $index = 0;
        foreach ($reflectionMethod->getParameters() as $reflectionParameter) {
            if ($index >= $parametersCount && !$reflectionParameter->isOptional()) {
                return false;
            }

            $index++;
        }

        return true;
    }