public function registerFunction(ExpressionFunctionInterface $function)
    {
        $this->expressionLanguage->register(
            $function->getName(),
            $function->getCompiler(),
            $function->getEvaluator()
        );

        foreach ($function->getContextVariables() as $name => $value) {
            $this->setContextVariable($name, $value);
        }

        return $this;
    }