src/Reflection/ReflectionFunctionAbstract.php
public function removeParameter(string $parameterName) : void
    {
        $lowerName = strtolower($parameterName);

        foreach ($this->node->params as $key => $paramNode) {
            if ($paramNode->var instanceof Node\Expr\Error) {
                throw new LogicException('PhpParser left an "Error" node in the parameters AST, this should NOT happen');
            }

            if (! is_string($paramNode->var->name) || strtolower($paramNode->var->name) !== $lowerName) {
                continue;
            }

            unset($this->node->params[$key]);
        }
    }
public function removeParameter(string $parameterName) : void
    {
        $lowerName = strtolower($parameterName);

        foreach ($this->node->params as $key => $paramNode) {
            if ($paramNode->var instanceof Node\Expr\Error) {
                throw new LogicException('PhpParser left an "Error" node in the parameters AST, this should NOT happen');
            }

            if (! is_string($paramNode->var->name) || strtolower($paramNode->var->name) !== $lowerName) {
                continue;
            }

            unset($this->node->params[$key]);
        }
    }
Remove a parameter from the method/function.