Returns an array of Twig functions, used in Twig templates via:

{% set this = someFunction('something') %}

@return array
766662
public function getFunctions()
    {
        return [
            new \Twig_SimpleFunction('isEager', function($stuff) {
                return AgnosticFetchHelper::isEager($stuff);
            }),
            new \Twig_SimpleFunction('all', function($stuff) {
                return AgnosticFetchHelper::all($stuff);
            }),
            new \Twig_SimpleFunction('one', function($stuff) {
                return AgnosticFetchHelper::one($stuff);
            }),
            new \Twig_SimpleFunction('nth', function($stuff, $n) {
                return AgnosticFetchHelper::nth($stuff, $n);
            }),
            new \Twig_SimpleFunction('ids', function($stuff) {
                return AgnosticFetchHelper::ids($stuff);
            }),
            new \Twig_SimpleFunction('count', function($stuff) {
                return AgnosticFetchHelper::count($stuff);
            }),
        ];
    }
447284
public function functions()
    {
        if (is_null($this->functionRequests)) {
            $this->functionRequests = new FunctionRequests($this->client);
        }

        return $this->functionRequests;
    }
551254
public function getFunctions()
    {
        if (!isset($this->fileFunctions)) {
            $this->fileFunctions = $this->findFunctions();
        }

        return $this->fileFunctions;
    }
171437
public function getFunctions() {
        return array(
            new \Twig_SimpleFunction('gchart_area_chart', array($this, 'gchartAreaChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_bar_chart', array($this, 'gchartBarChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_bubble_chart', array($this, 'gchartBubbleChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_calendar', array($this, 'gchartCalendar'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_candlestick_chart', array($this, 'gchartCandleStickChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_column_chart', array($this, 'gchartColumnChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_combo_chart', array($this, 'gchartComboChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_donut_chart', array($this, 'gchartDonutChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_gantt', array($this, 'gchartGantt'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_gauge', array($this, 'gchartGauge'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_geo_chart', array($this, 'gchartGeoChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_get_icon_pin_url', array($this, 'getIconPinUrl'), array('is_safe' => array('html'))),
            new \Twig_SimpleFunction('gchart_get_icon_url', array($this, 'getIconUrl'), array('is_safe' => array('html'))),
            new \Twig_SimpleFunction('gchart_get_letter_pin_url', array($this, 'getLetterPinUrl'), array('is_safe' => array('html'))),
            new \Twig_SimpleFunction('gchart_get_pie_chart_url', array($this, 'getPieChartUrl'), array('is_safe' => array('html'))),
            new \Twig_SimpleFunction('gchart_get_pie_chart3d_url', array($this, 'getPieChart3DUrl'), array('is_safe' => array('html'))),
            new \Twig_SimpleFunction('gchart_get_qrcode_url', array($this, 'getQrCodeUrl')),
            new \Twig_SimpleFunction('gchart_histogram', array($this, 'gchartHistogram'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_interval', array($this, 'gchartInterval'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_line_chart', array($this, 'gchartLineChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_map', array($this, 'gchartMap'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_org_chart', array($this, 'gchartOrgChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_pie_chart', array($this, 'gchartPieChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_sankey', array($this, 'gchartSankey'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_scatter_chart', array($this, 'gchartScatterChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_stepped_area_chart', array($this, 'gchartSteppedAreaChart'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_table', array($this, 'gchartTable'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_timeline', array($this, 'gchartTimeline'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_treemap', array($this, 'gchartTreeMap'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_trendlines', array($this, 'gchartTrendlines'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_waterfall', array($this, 'gchartWaterfall'), array('is_safe' => array('html'), 'needs_environment' => true)),
            new \Twig_SimpleFunction('gchart_word_tree', array($this, 'gchartWordTree'), array('is_safe' => array('html'), 'needs_environment' => true)),
        );
    }
1352967
public function getFunctions () {
		return [
			//==============================================
			//base
			//==============================================
			new \Twig_Function('asset',					[$this, 'asset']),
			new \Twig_Function('asset_common',			[$this, 'assetCommon']),
			new \Twig_Function('asset_cdn',				[$this, 'assetCdn']),
			new \Twig_Function('make_url',				[$this, 'makeUrl']),
			new \Twig_Function('make_domain_url',		[$this, 'makeDomainUrl']),
			new \Twig_Function('make_force_domain_url',	[$this, 'makeForceDomainUrl']),
			new \Twig_Function('current_url',			[$this, 'currentUrl']),
			new \Twig_Function('current_full_url',		[$this, 'currentFullUrl']),
			new \Twig_Function('filter',				[$this, 'filter'], ['needs_environment' => true]),
			new \Twig_Function('replace_sub_domain',	[$this, 'replaceSubDomain']),
			new \Twig_Function('action_switch',			[$this, 'actionSwitch']),

			//==============================================
			//var type
			//==============================================
			new \Twig_Function('var_dump',		'var_dump'),

			new \Twig_Function('empty',			[$this, 'isEmpty']),

			new \Twig_Function('adjust_array',	'\ickx\fw2\vartype\arrays\Arrays::AdjustArray'),
			new \Twig_Function('array_unshift',	[$this, 'arrayUnshift']),
			new \Twig_Function('array_push',	[$this, 'arrayPush']),
			new \Twig_Function('array_add',		[$this, 'arrayAdd']),
			new \Twig_Function('array_merge',	[$this, 'merge']),
			new \Twig_Function('implode',		'implode'),
			new \Twig_Function('explode',		'explode'),
			new \Twig_Function('array_filter',	'array_filter'),

			new \Twig_Function('merge',			[$this, 'merge']),

			new \Twig_Function('late_array_bind',	[$this, 'lateArrayBind']),

			//==============================================
			//Native Functions
			//==============================================
			new \Twig_Function('time',	'time'),
			new \Twig_Function('date',	'date'),

			//==============================================
			//disp support
			//==============================================
			new \Twig_Function('adjust',		[$this, 'adjust']),
			new \Twig_Function('params_adjust',	[$this, 'paramsAdjust']),
			new \Twig_Function('sprintf',		'sprintf'),
			new \Twig_Function('has_validator',	[$this, 'hasValidator']),
			new \Twig_Function('elvis',			[$this, 'elvis']),
			new \Twig_Function('switch',		[$this, 'elvis']),

			new \Twig_Function('make_id',		[$this, 'makeId']),

			new \Twig_Function('json_encode',	[$this, 'jsonEncode']),
			new \Twig_Function('json_decode',	[$this, 'jsonDecode']),

			//==============================================
			//form data set
			//==============================================
			//form status
			new \Twig_Function('form_open',				[$this, 'formOpen']),
			new \Twig_Function('form_status',			[$this, 'formStatus']),
			new \Twig_Function('is_post_form',			[$this, 'isPostForm']),
			new \Twig_Function('form_close',			[$this, 'formClose']),
			//file upload
			new \Twig_Function('file_upload',			[$this, 'fileUpload']),
			//CURRENT REQUEST data
			new \Twig_Function('exist_request_data',	[$this, 'existRequestData']),
			new \Twig_Function('request_data',			[$this, 'getRequestData']),
			new \Twig_Function('request_data_set',		[$this, 'getRequestDataSet']),
			//GET parameter
			new \Twig_Function('exist_parameter',		[$this, 'existParameter']),
			new \Twig_Function('parameter',				[$this, 'getParameter']),
			new \Twig_Function('parameters',			[$this, 'getParameters']),
			//POST data
			new \Twig_Function('exist_form_data',		[$this, 'existFormData']),
			new \Twig_Function('form_data',				[$this, 'getFormData']),
			new \Twig_Function('form_data_set',			[$this, 'getFormDataSet']),
			//message
			//error
			new \Twig_Function('exist_errors',			[$this, 'existError']),
			new \Twig_Function('errors',				[$this, 'getError']),
			new \Twig_Function('errors_set',			[$this, 'getErrorSet']),
			//warn
			new \Twig_Function('exist_warns',			[$this, 'existWarn']),
			new \Twig_Function('warns',					[$this, 'getWarn']),
			new \Twig_Function('warns_set',				[$this, 'getWarnSet']),
			//info
			new \Twig_Function('exist_infos',			[$this, 'existInfo']),
			new \Twig_Function('infos',					[$this, 'getInfo']),
			new \Twig_Function('infos_set',				[$this, 'getInfoSet']),
		];
	}
286840
function &functions()
    {
        $functions = array();
        $packages = $this->packages(); // not by reference so as not to move the internal array pointer
        foreach ($packages as $name => $package) {
            $packageFunctions = $this->_packages[$name]->functions(); // not by reference so as not to move the internal array pointer
            if ($packageFunctions) {
                foreach ($packageFunctions as $key => $pack) {
                    $functions[$name.'.'.$key] =& $packageFunctions[$key];
                }
            }
        }

        return $functions;
    }
906725
public function getFunctions()
	{
		return array(
			'fuel_version'      => new Twig_Function_Method($this, 'fuel_version'),
			'url'               => new Twig_Function_Method($this, 'url'),

			'base_url'          => new Twig_Function_Function('Uri::base'),
			'current_url'       => new Twig_Function_Function('Uri::current'),
			'uri_segment'       => new Twig_Function_Function('Uri::segment'),
			'uri_segments'      => new Twig_Function_Function('Uri::segments'),

			'config'            => new Twig_Function_Function('Config::get'),

			'lang'              => new Twig_Function_Function('Lang::get'),

			'form_open'         => new Twig_Function_Function('Form::open'),
			'form_close'        => new Twig_Function_Function('Form::close'),
			'form_input'        => new Twig_Function_Function('Form::input'),
			'form_password'     => new Twig_Function_Function('Form::password'),
			'form_hidden'       => new Twig_Function_Function('Form::hidden'),
			'form_radio'        => new Twig_Function_Function('Form::radio'),
			'form_checkbox'     => new Twig_Function_Function('Form::checkbox'),
			'form_textarea'     => new Twig_Function_Function('Form::textarea'),
			'form_file'         => new Twig_Function_Function('Form::file'),
			'form_button'       => new Twig_Function_Function('Form::button'),
			'form_reset'        => new Twig_Function_Function('Form::reset'),
			'form_submit'       => new Twig_Function_Function('Form::submit'),
			'form_select'       => new Twig_Function_Function('Form::select'),
			'form_label'        => new Twig_Function_Function('Form::label'),

			'form_val'          => new Twig_Function_Function('Input::param'),
			'input_get'         => new Twig_Function_Function('Input::get'),
			'input_post'        => new Twig_Function_Function('Input::post'),

			'asset_add_path'    => new Twig_Function_Function('Asset::add_path'),
			'asset_css'         => new Twig_Function_Function('Asset::css'),
			'asset_js'          => new Twig_Function_Function('Asset::js'),
			'asset_img'         => new Twig_Function_Function('Asset::img'),
			'asset_render'      => new Twig_Function_Function('Asset::render'),
			'asset_find_file'   => new Twig_Function_Function('Asset::find_file'),

			'html_anchor'       => new Twig_Function_Function('Html::anchor'),

			'session_get'       => new Twig_Function_Function('Session::get'),
			'session_get_flash' => new Twig_Function_Function('Session::get_flash'),

			'markdown_parse'    => new Twig_Function_Function('Markdown::parse'),

			'auth_has_access'   => new Twig_Function_Function('Auth::has_access'),
			'auth_check'        => new Twig_Function_Function('Auth::check')
		);
	}
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);
                }
            ),
        ];
    }
133033
public function getFunctions()
    {
        $stmts = [];
        $stmts['drop/function/slugify'] = 'DROP FUNCTION IF EXISTS `slugify`';
        $stmts['create/function/slugify'] = <<< ENDQ
        CREATE FUNCTION `slugify` (dirty_string VARCHAR(255))
        RETURNS VARCHAR(255) CHARSET latin1
        DETERMINISTIC
        BEGIN
            DECLARE x, y , z INT;
            DECLARE temp_string, new_string VARCHAR(255);
            DECLARE is_allowed BOOL;
            DECLARE c, check_char VARCHAR(1);

            SET temp_string = LOWER(dirty_string);

            SET temp_string = REPLACE(temp_string, '&', ' and ');

            SELECT temp_string REGEXP('[^a-z0-9\-]+') INTO x;
            IF x = 1 THEN
                SET z = 1;
                WHILE z <= CHAR_LENGTH(temp_string) DO
                    SET c = SUBSTRING(temp_string, z, 1);
                    SET is_allowed = FALSE;
                    IF !((ascii(c) = 45) or (ascii(c) >= 48 and ascii(c) <= 57) or (ascii(c) >= 97 and ascii(c) <= 122)) THEN
                        SET temp_string = REPLACE(temp_string, c, '-');
                    END IF;
                    SET z = z + 1;
                END WHILE;
            END IF;

            SELECT temp_string REGEXP("^-|-$|'") INTO x;
            IF x = 1 THEN
                SET temp_string = REPLACE(temp_string, "'", '');
                SET z = CHAR_LENGTH(temp_string);
                SET y = CHAR_LENGTH(temp_string);
                Dash_check: WHILE z > 1 DO
                    IF STRCMP(SUBSTRING(temp_string, -1, 1), '-') = 0 THEN
                        SET temp_string = SUBSTRING(temp_string,1, y-1);
                        SET y = y - 1;
                    ELSE
                        LEAVE Dash_check;
                    END IF;
                    SET z = z - 1;
                END WHILE;
            END IF;

            REPEAT
                SELECT temp_string REGEXP("--") INTO x;
                IF x = 1 THEN
                    SET temp_string = REPLACE(temp_string, "--", "-");
                END IF;
            UNTIL x <> 1 END REPEAT;

            IF LOCATE('-', temp_string) = 1 THEN
                SET temp_string = SUBSTRING(temp_string, 2);
            END IF;

            RETURN temp_string;
        END        
ENDQ;

        $stmts['drop/function/strip_tags'] = 'DROP FUNCTION IF EXISTS `strip_tags`';
        $stmts['create/function/strip_tags'] = <<< 'ENDQ'
        CREATE FUNCTION strip_tags( DIRTY VARCHAR(3000) )
        RETURNS VARCHAR(3000) CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci
        DETERMINISTIC 
        BEGIN
          DECLARE iStart, iEnd, iLength int;
            WHILE LOCATE( '<', DIRTY ) > 0 And LOCATE( '>', DIRTY, LOCATE( '<', DIRTY )) > 0 DO
              BEGIN
                SET iStart = LOCATE( '<', DIRTY ), iEnd = LOCATE( '>', DIRTY, LOCATE('<', DIRTY ));
                SET iLength = ( iEnd - iStart) + 1;
                IF iLength > 0 THEN
                  BEGIN
                    SET DIRTY = INSERT( DIRTY, iStart, iLength, '');
                  END;
                END IF;
              END;
            END WHILE;
            RETURN DIRTY;
        END;
ENDQ;

        $stmts['drop/function/delete_double_spaces'] = 'DROP FUNCTION IF EXISTS `delete_double_spaces`';
        $stmts['create/function/delete_double_spaces'] = <<< 'ENDQ'
        CREATE FUNCTION delete_double_spaces ( title VARCHAR(3000) )
        RETURNS VARCHAR(3000) CHARSET utf8mb4 COLLATE utf8mb4_unicode_ci 
        DETERMINISTIC
        BEGIN
            DECLARE result VARCHAR(3000);
            SET result = REPLACE( title, '  ', ' ' );
            WHILE (result <> title) DO 
                SET title = result;
                SET result = REPLACE( title, '  ', ' ' );
            END WHILE;
            RETURN result;
        END;
ENDQ;

        $stmts['drop/function/get_searchable_reference'] = 'DROP FUNCTION IF EXISTS `get_searchable_reference`';
        $stmts['create/function/get_searchable_reference'] = <<< 'ENDQ'
        CREATE FUNCTION `get_searchable_reference` (`in_str` VARCHAR(2048)) 
        RETURNS VARCHAR(2048) CHARSET utf8mb4
        DETERMINISTIC        
        BEGIN
            /*
              This function escape a string from any non alphanumeric chars (A_Z0_9)
              to get a searchable reference. Also try to remove any first 
              non-significative zero.

              FOR example 'BA-0114-22' -> 'BA11422'  

            */    
            DECLARE out_str VARCHAR(2048) DEFAULT '';
            DECLARE c VARCHAR(1) DEFAULT '';
            DECLARE prev_c VARCHAR(1) DEFAULT '';
            DECLARE pointer INT DEFAULT 1;

            IF ISNULL(in_str) THEN
                RETURN NULL;
            ELSE
                WHILE pointer <= LENGTH(in_str) DO
                    SET c = UPPER(MID(in_str, pointer, 1));

                    -- TAKE ONLY [A-Z0-9] characters
                    IF  ((ASCII(c) > 64 AND ASCII(c) < 92) or (ASCII(c) > 47 AND ASCII(c) < 58))
                    THEN
                        -- IF A NUMBER, try to get rid of non-significave numbers
                        IF (ASCII(c) > 47 AND ASCII(c) < 58)
                        THEN 
                            -- IF C is a zero and PREVIOUS CHARACTER IS NUMERIC
                            IF (c = 0 and NOT (ASCII(prev_c) > 47 AND ASCII(prev_c) < 58))
                            THEN
                                -- NOTHING
                                SET c = c;
                            ELSE
                                SET out_str = CONCAT(out_str, c);
                            END IF;
                        ELSE 
                            SET out_str = CONCAT(out_str, c);
                        END IF;
                    END IF;
                    SET prev_c = c;
                    SET pointer = pointer + 1;
                END WHILE;
            END IF;

            RETURN UPPER(out_str);
        END;
ENDQ;

        return $stmts;
    }
1105122
public function getFunctions(): array
    {
        return [
            new TwigFunction('time', function ($time = null, $timezone = null) {
                return new CakeTime($time, $timezone);
            }),
            new TwigFunction('timezones', 'Cake\I18n\Time::listTimezones'),
        ];
    }
103255
public function getFunctions(): array
    {
        $options = ['is_safe' => ['html']];
        return [
            new Twig_Function('logged_in_user', [$this, 'getLoggedInUser'], $options),
            new Twig_Function('msg', [$this, 'msg'], $options),
            new Twig_Function('bdi', [$this, 'bdi'], $options),
            new Twig_Function('msg_exists', [$this, 'msgExists'], $options),
            new Twig_Function('msg_if_exists', [$this, 'msgIfExists'], $options),
            new Twig_Function('lang', [$this, 'getLang'], $options),
            new Twig_Function('lang_name', [$this, 'getLangName'], $options),
            new Twig_Function('all_langs', [$this, 'getAllLangs']),
            new Twig_Function('is_rtl', [$this, 'isRtl']),
            new Twig_Function('git_branch', [$this, 'gitBranch']),
            new Twig_Function('git_hash', [$this, 'gitHash']),
            new Twig_Function('git_hash_short', [$this, 'gitHashShort']),
        ];
    }
1066076
public function getFunctions()
    {
        return array_merge(parent::getFunctions(), [
            new \Twig_SimpleFunction('getBlockElementsHtml', [$this, 'getBlockElementsHtml'], ['is_safe' => ['html']]),
            new \Twig_SimpleFunction('getElementHtml', [$this, 'getElementHtml'], ['is_safe' => ['html']]),
            new \Twig_SimpleFunction('getCollectionPages', [$this, 'getCollectionPages']),
            new \Twig_SimpleFunction('getGallery', [$this, 'getGallery']),
        ]);
    }
856962
protected function getFunctions() {
        if (!$this->_functions) {
            $this->_functions = new FunctionList($this->version, $this->solution['sid']);
        }

        return $this->_functions;
    }
202836
public function getFilters()
    {
        $language = $this->container->get('language');

        return [
            new \Twig_SimpleFilter('trans', [$language, 'translate']),
            new \Twig_SimpleFilter('lang', [$language, 'translate']),
            new \Twig_SimpleFilter('translate', [$language, 'translate']),
            new \Twig_SimpleFilter('_', [$language, 'translate']),
            new \Twig_SimpleFilter('sprintf', function (...$args) use ($language) {
                return $language->sprintf(...$args);
            }),
            new \Twig_SimpleFilter('plural', function (...$args) use ($language) {
                return $language->plural(...$args);
            }),
        ];
    }
351907
public List<FunctionType<TldTaglibType<T>>> getAllFunction()
   {
      List<FunctionType<TldTaglibType<T>>> list = new ArrayList<FunctionType<TldTaglibType<T>>>();
      List<Node> nodeList = childNode.get("function");
      for(Node node: nodeList)
      {
         FunctionType<TldTaglibType<T>>  type = new FunctionTypeImpl<TldTaglibType<T>>(this, "function", childNode, node);
         list.add(type);
      }
      return list;
   }
493448
public function getFunctions()
    {
        return [
            new \Twig_SimpleFunction('array', [$this, 'arrayFilter']),
            new \Twig_SimpleFunction('array_key_value', [$this, 'arrayKeyValueFunc']),
            new \Twig_SimpleFunction('array_key_exists', 'array_key_exists'),
            new \Twig_SimpleFunction('array_unique', 'array_unique'),
            new \Twig_SimpleFunction('array_intersect', [$this, 'arrayIntersectFunc']),
            new \Twig_SimpleFunction('authorize', [$this, 'authorize']),
            new \Twig_SimpleFunction('debug', [$this, 'dump'], ['needs_context' => true, 'needs_environment' => true]),
            new \Twig_SimpleFunction('dump', [$this, 'dump'], ['needs_context' => true, 'needs_environment' => true]),
            new \Twig_SimpleFunction('vardump', [$this, 'vardumpFunc']),
            new \Twig_SimpleFunction('print_r', 'print_r'),
            new \Twig_SimpleFunction('http_response_code', 'http_response_code'),
            new \Twig_SimpleFunction('evaluate', [$this, 'evaluateStringFunc'], ['needs_context' => true]),
            new \Twig_SimpleFunction('evaluate_twig', [$this, 'evaluateTwigFunc'], ['needs_context' => true]),
            new \Twig_SimpleFunction('gist', [$this, 'gistFunc']),
            new \Twig_SimpleFunction('nonce_field', [$this, 'nonceFieldFunc']),
            new \Twig_SimpleFunction('pathinfo', 'pathinfo'),
            new \Twig_SimpleFunction('random_string', [$this, 'randomStringFunc']),
            new \Twig_SimpleFunction('repeat', [$this, 'repeatFunc']),
            new \Twig_SimpleFunction('regex_replace', [$this, 'regexReplace']),
            new \Twig_SimpleFunction('regex_filter', [$this, 'regexFilter']),
            new \Twig_SimpleFunction('string', [$this, 'stringFunc']),
            new \Twig_SimpleFunction('url', [$this, 'urlFunc']),
            new \Twig_SimpleFunction('json_decode', [$this, 'jsonDecodeFilter']),
            new \Twig_SimpleFunction('get_cookie', [$this, 'getCookie']),
            new \Twig_SimpleFunction('redirect_me', [$this, 'redirectFunc']),
            new \Twig_SimpleFunction('range', [$this, 'rangeFunc']),
            new \Twig_SimpleFunction('isajaxrequest', [$this, 'isAjaxFunc']),
            new \Twig_SimpleFunction('exif', [$this, 'exifFunc']),
            new \Twig_SimpleFunction('media_directory', [$this, 'mediaDirFunc']),
            new \Twig_SimpleFunction('body_class', [$this, 'bodyClassFunc']),
            new \Twig_SimpleFunction('theme_var', [$this, 'themeVarFunc']),
            new \Twig_SimpleFunction('header_var', [$this, 'pageHeaderVarFunc']),
            new \Twig_SimpleFunction('read_file', [$this, 'readFileFunc']),
            new \Twig_SimpleFunction('nicenumber', [$this, 'niceNumberFunc']),
            new \Twig_SimpleFunction('nicefilesize', [$this, 'niceFilesizeFunc']),
            new \Twig_SimpleFunction('nicetime', [$this, 'nicetimeFunc']),
            new \Twig_SimpleFunction('cron', [$this, 'cronFunc']),
            new \Twig_SimpleFunction('xss', [$this, 'xssFunc']),


            // Translations
            new \Twig_SimpleFunction('t', [$this, 'translate'], ['needs_environment' => true]),
            new \Twig_SimpleFunction('tl', [$this, 'translateLanguage']),
            new \Twig_SimpleFunction('ta', [$this, 'translateArray']),

            // Object Types
            new \Twig_SimpleFunction('get_type', [$this, 'getTypeFunc']),
            new \Twig_SimpleFunction('of_type', [$this, 'ofTypeFunc'])
        ];
    }
856640
public function getFunctions()
    {
        return [
            new SimpleFunction('url', function($url) {
                $args = func_get_args();
                return call_user_func_array([$this, 'getUrl'], $args);
            }),
            new SimpleFunction(
                'addCss',
                function($file, $path='/css', $attr = []) {
                    return $this->addCss($file, $path, $attr);
                }
            ),
            new SimpleFunction(
                'addJs',
                function($file, $path='/javascripts') {
                    return $this->addJs($file, $path);
                }
            )
        ];
    }