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;
    }