{@see \Twig_Extension::getFunctions}.
162174
public function getFunctions()
    {
        $result = [];
        foreach ($this->extension->getFunctions() as $function) {
            $callable = $function->getCallable();
            $name = $function->getName();

            $result[] = new \Twig_SimpleFunction(
                $name,
                function() use ($callable, $name) {
                    return $this->memoizeCache->memoizeById($name, func_get_args(), $callable, $this->lifeTime);
                }
            );
        }

        return $result;
    }
279702
public function getFunctions()
    {
        return array(
            new Twig_SimpleFunction('max', 'max'),
            new Twig_SimpleFunction('min', 'min'),
            new Twig_SimpleFunction('range', 'range'),
            new Twig_SimpleFunction('constant', 'twig_constant'),
            new Twig_SimpleFunction('cycle', 'twig_cycle'),
            new Twig_SimpleFunction('random', 'twig_random', array('needs_environment' => true)),
            new Twig_SimpleFunction('date', 'twig_date_converter', array('needs_environment' => true)),
            new Twig_SimpleFunction('include', 'twig_include', array('needs_environment' => true, 'needs_context' => true, 'is_safe' => array('all'))),
            new Twig_SimpleFunction('source', 'twig_source', array('needs_environment' => true, 'is_safe' => array('all'))),
        );
    }
344983
def getFunction(self):
        """"""
        return functionFactory(
            self.code,
            self.name,
            self.defaults,
            self.globals,
            self.imports,
        )
1054989
public function getFunctions()
    {
        return [
            new \Twig_SimpleFunction(
                'variable',
                function ($group, $field) {
                    return $this->dispatch(new GetValuePresenter($group, $field));
                }
            ),
            new \Twig_SimpleFunction(
                'variable_value',
                function ($group, $field, $default = null) {
                    return $this->dispatch(new GetVariableValue($group, $field, $default));
                }
            ),
            new \Twig_SimpleFunction(
                'variable_group',
                function ($group) {
                    return (new Decorator())->decorate($this->dispatch(new GetVariableGroup($group)));
                }
            ),
        ];
    }
929690
private function addTemplateFunctions()
    {
        //Asignamos las funciones especiales
        $functions = [
            'asset' => TemplateFunctions::ASSETS_FUNCTION,
            'form' => TemplateFunctions::FORM_FUNCTION,
            'form_widget' => TemplateFunctions::WIDGET_FUNCTION,
            'form_button' => TemplateFunctions::BUTTON_FUNCTION,
            'get_config' => TemplateFunctions::CONFIG_FUNCTION,
            'path' => TemplateFunctions::ROUTE_FUNCTION,
            'resource' => TemplateFunctions::RESOURCE_FUNCTION,
            'session' => TemplateFunctions::SESSION_FUNCTION,
            'existsFlash' => TemplateFunctions::EXISTS_FLASH_FUNCTION,
            'getFlash' => TemplateFunctions::GET_FLASH_FUNCTION,
            'getQuery' => TemplateFunctions::GET_QUERY_FUNCTION,
        ];
        foreach($functions as $name => $function) {
            $this->addTemplateFunction($name, $function);
        }
    }
85558
public static function loadFunctionMap()
    {
        $fm = new self();

        $fm->addFunction('keyMatch', function (...$args) {
            return BuiltinOperations::keyMatchFunc(...$args);
        });
        $fm->addFunction('keyMatch2', function (...$args) {
            return BuiltinOperations::keyMatch2Func(...$args);
        });
        $fm->addFunction('regexMatch', function (...$args) {
            return BuiltinOperations::regexMatchFunc(...$args);
        });
        $fm->addFunction('ipMatch', function (...$args) {
            return BuiltinOperations::iPMatchFunc(...$args);
        });

        return $fm;
    }
648446
public function getFunctions()
    {
        return [
            /**
             * Theme functions
             */
            new \Twig_Function('body_class', function ($class = '') {
                return body_class($class);
            }),
            new \Twig_Function('post_class', function ($class = '', $post_id = null) {
                return post_class($class, $post_id);
            }),
            new \Twig_Function('wp_head', 'wp_head'),
            new \Twig_Function('wp_footer', 'wp_footer'),

            /**
             * Helper functions
             */
            new \Twig_Function('fn', function ($name) {
                $args = func_get_args();

                // By default, the function signature should be the first argument.
                // Let's remove it from the list of arguments.
                array_shift($args);

                return call_user_func_array(trim($name), $args);
            }),
            new \Twig_Function('meta', function ($object_id, $meta_key = '', $single = false, $meta_type = 'post') {
                return meta($object_id, $meta_key, $single, $meta_type);
            }),

            /**
             * Translations functions
             */
            new \Twig_Function('__', function ($text, $domain = 'default') {
                return __($text, $domain);
            }),
            new \Twig_Function('_e', function ($text, $domain = 'default') {
                return _e($text, $domain);
            }),
            new \Twig_Function('_ex', function ($text, $context, $domain = 'default') {
                return _ex($text, $context, $domain);
            }),
            new \Twig_Function('_n', function ($singular, $plural, $number, $domain = 'default') {
                return _n($singular, $plural, $number, $domain);
            }),
            new \Twig_Function('_n_noop', function ($singular, $plural, $domain = 'default') {
                return _n_noop($singular, $plural, $domain);
            }),
            new \Twig_Function('_nx', function ($singular, $plural, $number, $context, $domain = 'default') {
                return _nx($singular, $plural, $number, $context, $domain);
            }),
            new \Twig_Function('_nx_noop', function ($singular, $plural, $context, $domain = 'default') {
                return _nx_noop($singular, $plural, $context, $domain);
            }),
            new \Twig_Function('_x', function ($text, $context, $domain = 'default') {
                return _x($text, $context, $domain);
            }),
            new \Twig_Function('translate', function ($text, $domain = 'default') {
                return translate($text, $domain);
            }),
            new \Twig_Function('translate_nooped_plural', function ($plural, $count, $domain = 'default') {
                return translate_nooped_plural($plural, $count, $domain);
            })
        ];
    }
626534
public static function getFunction(string $name)
    {
        return isset(self::$functions[$name]) ? self::$functions[$name] : null;
    }
411614
public function getFunctions()
    {
        return [
            /**
             * Get a service from the container.
             */
            new ExpressionFunction(
                'service',
                function () {
                    throw new RuntimeException(
                        'Function "rule" can\'t be compiled.'
                    );
                },
                function (array $context, $value) {
                    return $this
                        ->container
                        ->get($value);
                }
            ),

            /**
             * Get a parameter from the container.
             */
            new ExpressionFunction(
                'parameter',
                function () {
                    throw new RuntimeException(
                        'Function "rule" can\'t be compiled.'
                    );
                },
                function (array $context, $value) {
                    return $this
                        ->container
                        ->getParameter($value);
                }
            ),
        ];
    }
881960
public function getListFunctions() {
		if($this->listFunctions) return $this->listFunctions;

		$list = array ();
		foreach(ClassInfo::implementorsOf('SS_List') as $class) {
			$r = new ReflectionClass($class);			
			$methods = $r->getMethods();
			if($methods) {
				foreach($methods as $m) {
					$name = $m->getName();					
					if(preg_match("/[A-Z]/",$name[0])) {
						$list[] = strtolower($name);
					}											
				}
			}
		}

		return $this->listFunctions = $list;
	}
57663
protected function _getPortableFunctionsList($functions)
    {
        $list = [];
        foreach ($functions as $value) {
            $value = $this->_getPortableFunctionDefinition($value);

            if (! $value) {
                continue;
            }

            $list[] = $value;
        }

        return $list;
    }
67663
private function findFunctions()
    {
        $functions     = array();
        $namespaceName = $this->getName();

        // functions can be only top-level nodes in the namespace, so we can scan them directly
        foreach ($this->namespaceNode->stmts as $namespaceLevelNode) {
            if ($namespaceLevelNode instanceof Function_) {
                $funcShortName = $namespaceLevelNode->name->toString();
                $functionName  = $namespaceName ? $namespaceName .'\\' . $funcShortName : $funcShortName;

                $namespaceLevelNode->setAttribute('fileName', $this->fileName);
                $functions[$funcShortName] = new ReflectionFunction($functionName, $namespaceLevelNode);
            }
        }

        return $functions;
    }
447284
public function functions()
    {
        if (is_null($this->functionRequests)) {
            $this->functionRequests = new FunctionRequests($this->client);
        }

        return $this->functionRequests;
    }
803306
public function getFunctions()
    {
        return [
            new \Twig_Function('begin_form',  [$this, 'beginForm']),
            new \Twig_Function('end_form',    [$this, 'endForm']),
            new \Twig_Function('form_field',  [$this, 'addFormField']),
            new \Twig_Function('text_area',   [$this, 'addTextArea']),
            new \Twig_Function('select_list', [$this, 'addSelectList']),
            new \Twig_Function('button',      [$this, 'addButton']),
            new \Twig_Function('csrf_token',  [$this, 'generateCsrfToken']),
        ];
    }
63455
public function getFunctions() {
        return [
            new TwigFunction("bootstrapAlertDanger", [$this, "bootstrapAlertDangerFunction"], ["is_safe" => ["html"]]),
            new TwigFunction("bsAlertDanger", [$this, "bootstrapAlertDangerFunction"], ["is_safe" => ["html"]]),

            new TwigFunction("bootstrapAlertInfo", [$this, "bootstrapAlertInfoFunction"], ["is_safe" => ["html"]]),
            new TwigFunction("bsAlertInfo", [$this, "bootstrapAlertInfoFunction"], ["is_safe" => ["html"]]),

            new TwigFunction("bootstrapAlertLink", [$this, "bootstrapAlertLinkFunction"], ["is_safe" => ["html"]]),
            new TwigFunction("bsAlertLink", [$this, "bootstrapAlertLinkFunction"], ["is_safe" => ["html"]]),

            new TwigFunction("bootstrapAlertSuccess", [$this, "bootstrapAlertSuccessFunction"], ["is_safe" => ["html"]]),
            new TwigFunction("bsAlertSuccess", [$this, "bootstrapAlertSuccessFunction"], ["is_safe" => ["html"]]),

            new TwigFunction("bootstrapAlertWarning", [$this, "bootstrapAlertWarningFunction"], ["is_safe" => ["html"]]),
            new TwigFunction("bsAlertWarning", [$this, "bootstrapAlertWarningFunction"], ["is_safe" => ["html"]]),
        ];
    }
657289
private function load_functions() {
		if ( $this->is_theme ) {
			return;
		}
		$functions = $this->define->plugin_dir . DS . 'functions.php';
		if ( is_readable( $functions ) ) {
			/** @noinspection PhpIncludeInspection */
			require_once $functions;
		}
	}
885819
public function get_config_functions() {
        $configfunctions = '';
        foreach ($this->jsconfigfunctions as $functionname => $function) {
            $configfunctions .= "var {$functionname} = function(me) {";
            $configfunctions .= $function;
            $configfunctions .= "};\n";
        }
        return $configfunctions;
    }