Get the variables used by the Closure.

@return array
355090
public function getVariables()
    {
        if (!$this->getUseIndex()) {
            return array();
        }

        $staticVariables = $this->reflection->getStaticVariables();

        // When looping through the variables, we will only take the variables that are
        // specified in the use clause, and will not take any other static variables
        // that may be used by the Closures, allowing this to re-create its state.
        $usedVariables = array();

        foreach ($this->getUseClauseVariables() as $variable) {
            $variable = trim($variable, ' $&');

            $usedVariables[$variable] = $staticVariables[$variable];
        }

        return $usedVariables;
    }
669552
protected function getVariables()
    {
        $reflection = new ReflectionClass($this);
        foreach ($reflection->getProperties(
            ReflectionProperty::IS_PROTECTED |
            ReflectionProperty::IS_PRIVATE |
            ReflectionProperty::IS_STATIC
        ) as $property) {
            $ignore[] = $property->name;
        }
        $values = [];
        foreach ($this as $prop => $value) {
            if (!in_array($prop, $ignore)) {
                if (is_object($value)) {
                    if (method_exists($value, 'jsonSerialize')) {
                        $value = $value->jsonSerialize();
                    } elseif (method_exists($value, 'getArrayCopy')) {
                        $value = $value->getArrayCopy();
                    }
                }
                $values[$prop] = $value;
            }
        }
        return $values;
    }
369726
public function countUnusedVariables()
	{
		$unused	= 0;
		foreach( $this->methods as $method => $data )
			foreach( $this->methods[$method]['variables'] as $variable => $count )
				$unused	+= (int) !$count;
		return $unused;
	}
482712
private function getLayerVariables()
    {
        $variables = [];
        $layer     = $this->catalogLayer;

        if ($layer) {
            $layerState = $layer->getState();
            foreach ($layerState->getFilters() as $currentFilter) {
                $identifier = $currentFilter->getRequestVar();

                if ($currentFilter->getFilter()) {
                    $identifier = $currentFilter->getFilter()->getRequestVar();
                }

                $filterValue = $this->getRequest()->getParam($identifier, '');
                if (is_array($filterValue)) {
                    $filterValue = implode('|', $filterValue);
                }
                $variables['product_list.filters.' . $identifier] = html_entity_decode($filterValue);
            }
        }

        return $variables;
    }
1195521
public function getVariables()
    {
        $vars = [];
        /**
         * @var Cell\Cell $cell
         */
        foreach ($this->getCells() as $cell) {
            $vars += $cell->getContentVariables();
        }
        return $vars;
    }
1184150
private function getEnvironmentVariables()
    {
        // Initialize from globals, allow override of special keys via putenv calls.
        $variables = $this->inheritEnvironment
            ? array_replace($_ENV, $_SERVER, $this->environment)
            : $this->environment;

        foreach (array_keys($variables) as $name) {
            if (false !== ($value = getenv($name))) {
                $variables[$name] = $value;
            }
        }

        return $variables;
    }
1190172
protected function getVariables() {
        if (!$this->_variables) {
            $this->_variables = new VariableList(
                $this->version,
                $this->solution['serviceSid'],
                $this->solution['sid']
            );
        }

        return $this->_variables;
    }
1352213
protected function getVariables(): array
    {
        $variables               = $this->getBasicVariables();
        $variables['className']  = $this->name.'Controller';
        $variables['controller'] = $this->controller;

        return $variables;
    }
438403
public function getVariables() 
	{
		if(empty($this->countries)) {
			$this->countries = array(
				'GB' => 'United Kingdom',					'US' => 'United States',
				'AF' => 'Afghanistan',						'AL' => 'Albania',
				'DZ' => 'Algeria',							'AS' => 'American Samoa',
				'AD' => 'Andorra',							'AO' => 'Angola',
				'AI' => 'Anguilla',							'AQ' => 'Antarctica',
				'AG' => 'Antigua And Barbuda',				'AR' => 'Argentina',
				'AM' => 'Armenia',							'AW' => 'Aruba',
				'AU' => 'Australia',						'AT' => 'Austria',
				'AZ' => 'Azerbaijan',						'BS' => 'Bahamas',
				'BH' => 'Bahrain',							'BD' => 'Bangladesh',
				'BB' => 'Barbados',							'BY' => 'Belarus',
				'BE' => 'Belgium',							'BZ' => 'Belize',
				'BJ' => 'Benin',							'BM' => 'Bermuda',
				'BT' => 'Bhutan',							'BO' => 'Bolivia',
				'BA' => 'Bosnia And Herzegowina',			'BW' => 'Botswana',
				'BV' => 'Bouvet Island',					'BR' => 'Brazil',
				'IO' => 'British Indian Ocean Territory',	'BN' => 'Brunei Darussalam',
				'BG' => 'Bulgaria',							'BF' => 'Burkina Faso',
				'BI' => 'Burundi',							'KH' => 'Cambodia',
				'CM' => 'Cameroon',							'CA' => 'Canada',
				'CV' => 'Cape Verde',						'KY' => 'Cayman Islands',
				'CF' => 'Central African Republic',			'TD' => 'Chad',
				'CL' => 'Chile',							'CN' => 'China',
				'CX' => 'Christmas Island',					'CC' => 'Cocos (Keeling) Islands',
				'CO' => 'Colombia',							'KM' => 'Comoros',
				'CG' => 'Congo',							'CD' => 'Congo, The Democratic Republic Of The',
				'CK' => 'Cook Islands',						'CR' => 'Costa Rica',
				'CI' => 'Cote D\'Ivoire',					'HR' => 'Croatia (Local Name: Hrvatska)',
				'CU' => 'Cuba',								'CY' => 'Cyprus',
				'CZ' => 'Czech Republic',					'DK' => 'Denmark',
				'DJ' => 'Djibouti',							'DM' => 'Dominica',
				'DO' => 'Dominican Republic',				'TP' => 'East Timor',
				'EC' => 'Ecuador',							'EG' => 'Egypt',
				'SV' => 'El Salvador',						'GQ' => 'Equatorial Guinea',
				'ER' => 'Eritrea',							'EE' => 'Estonia',
				'ET' => 'Ethiopia',							'FK' => 'Falkland Islands (Malvinas)',
				'FO' => 'Faroe Islands',					'FJ' => 'Fiji',
				'FI' => 'Finland',							'FR' => 'France',
				'FX' => 'France, Metropolitan',				'GF' => 'French Guiana',
				'PF' => 'French Polynesia',					'TF' => 'French Southern Territories',
				'GA' => 'Gabon',							'GM' => 'Gambia',
				'GE' => 'Georgia',							'DE' => 'Germany',
				'GH' => 'Ghana',							'GI' => 'Gibraltar',
				'GR' => 'Greece',							'GL' => 'Greenland',
				'GD' => 'Grenada',							'GP' => 'Guadeloupe',
				'GU' => 'Guam',								'GT' => 'Guatemala',
				'GN' => 'Guinea',							'GW' => 'Guinea-Bissau',
				'GY' => 'Guyana',							'HT' => 'Haiti',
				'HM' => 'Heard And Mc Donald Islands',		'VA' => 'Holy See (Vatican City State)',
				'HN' => 'Honduras',							'HK' => 'Hong Kong',
				'HU' => 'Hungary',							'IS' => 'Iceland',
				'IN' => 'India',							'ID' => 'Indonesia',
				'IR' => 'Iran (Islamic Republic Of)',		'IQ' => 'Iraq',
				'IE' => 'Ireland',							'IL' => 'Israel',
				'IT' => 'Italy',							'JM' => 'Jamaica',
				'JP' => 'Japan',							'JO' => 'Jordan',
				'KZ' => 'Kazakhstan',						'KE' => 'Kenya',
				'KI' => 'Kiribati',							'KP' => 'Korea, Democratic People\'s Republic Of',
				'KR' => 'Korea, Republic Of',				'KW' => 'Kuwait',
				'KG' => 'Kyrgyzstan',						'LA' => 'Lao People\'s Democratic Republic',
				'LV' => 'Latvia',							'LB' => 'Lebanon',
				'LS' => 'Lesotho',							'LR' => 'Liberia',
				'LY' => 'Libyan Arab Jamahiriya',			'LI' => 'Liechtenstein',
				'LT' => 'Lithuania',						'LU' => 'Luxembourg',
				'MO' => 'Macau',							'MK' => 'Macedonia, Former Yugoslav Republic Of',
				'MG' => 'Madagascar',						'MW' => 'Malawi',
				'MY' => 'Malaysia',							'MV' => 'Maldives',
				'ML' => 'Mali',								'MT' => 'Malta',
				'MH' => 'Marshall Islands',					'MQ' => 'Martinique',
				'MR' => 'Mauritania',						'MU' => 'Mauritius',
				'YT' => 'Mayotte',							'MX' => 'Mexico',
				'FM' => 'Micronesia, Federated States Of',	'MD' => 'Moldova, Republic Of',
				'MC' => 'Monaco',							'MN' => 'Mongolia',
				'MS' => 'Montserrat',						'MA' => 'Morocco',
				'MZ' => 'Mozambique',						'MM' => 'Myanmar',
				'NA' => 'Namibia',							'NR' => 'Nauru',
				'NP' => 'Nepal',							'NL' => 'Netherlands',
				'AN' => 'Netherlands Antilles',				'NC' => 'New Caledonia',
				'NZ' => 'New Zealand',						'NI' => 'Nicaragua',
				'NE' => 'Niger',							'NG' => 'Nigeria',
				'NU' => 'Niue',								'NF' => 'Norfolk Island',
				'MP' => 'Northern Mariana Islands',			'NO' => 'Norway',
				'OM' => 'Oman',								'PK' => 'Pakistan',
				'PW' => 'Palau',							'PA' => 'Panama',
				'PG' => 'Papua New Guinea',					'PY' => 'Paraguay',
				'PE' => 'Peru',								'PH' => 'Philippines',
				'PN' => 'Pitcairn',							'PL' => 'Poland',
				'PT' => 'Portugal',							'PR' => 'Puerto Rico',
				'QA' => 'Qatar',							'RE' => 'Reunion',
				'RO' => 'Romania',							'RU' => 'Russian Federation',
				'RW' => 'Rwanda',							'KN' => 'Saint Kitts And Nevis',
				'LC' => 'Saint Lucia',						'VC' => 'Saint Vincent And The Grenadines',
				'WS' => 'Samoa',							'SM' => 'San Marino',
				'ST' => 'Sao Tome And Principe',			'SA' => 'Saudi Arabia',
				'SN' => 'Senegal',							'SC' => 'Seychelles',
				'SL' => 'Sierra Leone',						'SG' => 'Singapore',
				'SK' => 'Slovakia (Slovak Republic)',		'SI' => 'Slovenia',
				'SB' => 'Solomon Islands',					'SO' => 'Somalia',
				'ZA' => 'South Africa',						'GS' => 'South Georgia, South Sandwich Islands',
				'ES' => 'Spain',							'LK' => 'Sri Lanka',
				'SH' => 'St. Helena',						'PM' => 'St. Pierre And Miquelon',
				'SD' => 'Sudan',							'SR' => 'Suriname',
				'SJ' => 'Svalbard And Jan Mayen Islands',	'SZ' => 'Swaziland',
				'SE' => 'Sweden',							'CH' => 'Switzerland',
				'SY' => 'Syrian Arab Republic',				'TW' => 'Taiwan',
				'TJ' => 'Tajikistan',						'TZ' => 'Tanzania, United Republic Of',
				'TH' => 'Thailand',							'TG' => 'Togo',
				'TK' => 'Tokelau',							'TO' => 'Tonga',
				'TT' => 'Trinidad And Tobago',				'TN' => 'Tunisia',
				'TR' => 'Turkey',							'TM' => 'Turkmenistan',
				'TC' => 'Turks And Caicos Islands',			'TV' => 'Tuvalu',
				'UG' => 'Uganda',							'UA' => 'Ukraine',
				'AE' => 'United Arab Emirates',				'UM' => 'United States Minor Outlying Islands',
				'UY' => 'Uruguay',							'UZ' => 'Uzbekistan',
				'VU' => 'Vanuatu',							'VE' => 'Venezuela',
				'VN' => 'Viet Nam',							'VG' => 'Virgin Islands (British)',
				'VI' => 'Virgin Islands (U.S.)',			'WF' => 'Wallis And Futuna Islands',
				'EH' => 'Western Sahara',					'YE' => 'Yemen',
				'YU' => 'Yugoslavia',						'ZM' => 'Zambia',
				'ZW' => 'Zimbabwe');
		}
		
		return array(
			'pattern' => $this->pattern,
			'fields' => $this->show,
			'labels' => $this->labels,
			'data' => $this->data,
			'errors' => $this->errors,
			'holders' => $this->holders,
			'states' => $this->states,
			'regions' => $this->regions,
			'required' => $this->required,
			'neighborhoods' => $this->neighborhoods,
			'countries' => $this->countries);
	}
911780
public function variables()
    {
        if (!$this->hasKeyword('STUB')) {
            return $this->keyword('HEADING')->values;
        } elseif (!$this->hasKeyword('HEADING')) {
            return $this->keyword('STUB')->values;
        } else {
            return array_merge($this->keyword('STUB')->values, $this->keyword('HEADING')->values);
        }
    }
142031
private function getCategoryVariables()
    {
        $variables = [];

        if ($this->registry->registry('current_category')) {
            $category = $this->registry->registry('current_category');
            $variables['category.id']    = $category->getId();
            $variables['category.label'] = $category->getName();
            $variables['category.path']  = $category->getPath();
        }

        return $variables;
    }
253366
public function getVariables() 
	{
		$variables = parent::getVariables();
		
		$loaded = self::$loaded;
		self::$loaded = true;
		
		$variables['loaded'] = $loaded;
		$variables['options'] = $this->options;
		
		return $variables;
	}
739971
public function getVariables()
    {
        $variables = ['search.query' => $this->catalogSearchData->getEscapedQueryText()];

        if ($layer = $this->catalogLayer) {
            $productCollection = $layer->getProductCollection();
            $variables['search.is_spellchecked'] = (int) $productCollection->isSpellchecked();
        }

        return $variables;
    }
509245
private function getProductListVariables()
    {
        $variables = [];

        $productListBlock = $this->getProductListBlock();

        if ($productListBlock !== null && $productListBlock->getCollection()) {
            $variables['product_list.page_count'] = $productListBlock->getLastPageNum();
            $variables['product_list.product_count'] = $productListBlock->getTotalNum();
            $variables['product_list.current_page'] = $productListBlock->getCurrentPage();
            $variables['product_list.sort_order'] = $productListBlock->getCurrentOrder();
            $variables['product_list.sort_direction'] = $productListBlock->getCurrentDirection();
            $variables['product_list.display_mode'] = $productListBlock->getCurrentMode();
        }

        return $variables;
    }
335868
public function getVariableRefs()
	{
		$variableRefs = isset( $this->dimensionXPath2Expression )
			? $this->dimensionXPath2Expression->getParameterQNames()
			: array();

		if ( isset( $this->testXPath2Expression ) )
		{
			$variableRefs = array_merge( $variableRefs, $this->testXPath2Expression->getParameterQNames() );
		}

		return $variableRefs;
	}
945161
public function scriptVariables()
    {
        $lang = trans('sleeping_owl::lang');
        if ($lang == 'sleeping_owl::lang') {
            $lang = trans('sleeping_owl::lang', [], 'en');
        }

        return [
            'debug' => config('app.debug'),
            'env' => $this->app->environment(),
            'locale' => $this->app['translator']->getLocale(),
            'url' => $this->app['url']->to('/'),
            'lang' => $lang,
            'wysiwyg' => $this->config['wysiwyg'],
            'template' => $this->app[TemplateInterface::class]->toArray(),
            'user_id' => auth()->id(),
        ];
    }
1042202
protected function getParentVars()
    {
        $vars = array();
        $p = $this->getParent();
        while ($p) {
            $vars = array_merge($p->getVars(), $vars);
            $p = $p->getParent();
        }

        return $vars;
    }