code: protected function registerCustomFunctions()
      {
          $functionList = $this->functionGenerator->getFunctionList();
  
          foreach ($functionList as $function) {
              if (isset($function['name']) && isset($function['callable'])) {
                  $twigFunction = new Twig_SimpleFunction($function['name'], $function['callable']);
                  $this->engine->addFunction($twigFunction);
              }
          }
      }
docs: Registers custom functions.