Formulas/Resources/Variables/VariableSet.php
public function getBindingsAsVars( $vars = array() )
	{
		// $vars = array_merge( $existingVars, $this->parameters );
		$vars = $this->getParametersAsVars( $vars );

		foreach( $this->factVariableBindings as $bindingQName => /** @var \XBRL\Formulas\factVariableBinding $varBinding */ $varBinding )
		{
			if ( $varBinding->isFallback )
			{
				$current = $varBinding->yieldedFact;
			}
			else
			{
				// Using current makes sure the fact is set and the binding variables are correct
				if ( ! $varBinding->valid() ) $varBinding->rewind();
				$current = $varBinding->current();
			}
			if ( $current instanceof XPath2NodeIterator ) $current->Reset();
			$vars[ $bindingQName ] = $current;
			$vars = array_merge( $vars, $varBinding->getAdditionalVars() );
		}

		foreach( $this->generalVariableBindings as $bindingQName => /** @var VariableBinding $varBinding */ $varBinding )
		{
			// Using current makes sure the fact is set and the binding variables are correct
			// $vars[ $bindingQName ] = $this->variablesByQName[ $bindingQName ]->bindAsSequence ? $varBinding->facts : $varBinding->current();
			if ( ! $varBinding->valid() ) $varBinding->rewind();
			$current = $varBinding->current();
			if ( $current instanceof XPath2NodeIterator )
			{
				// BMS 2018-04-04 Test 0023 V-03 fails because the vars are being reset presumably because a var is not a clone
				$current = $current->CloneInstance();
				$current->Reset();
			}
			else if ( $current instanceof XPathNavigator)
			{
				$current = $current->CloneInstance();
			}
			$vars[ $bindingQName ] = $current;
		}

		return $vars;
	}
public function getBindingsAsVars( $vars = array() )
	{
		// $vars = array_merge( $existingVars, $this->parameters );
		$vars = $this->getParametersAsVars( $vars );

		foreach( $this->factVariableBindings as $bindingQName => /** @var \XBRL\Formulas\factVariableBinding $varBinding */ $varBinding )
		{
			if ( $varBinding->isFallback )
			{
				$current = $varBinding->yieldedFact;
			}
			else
			{
				// Using current makes sure the fact is set and the binding variables are correct
				if ( ! $varBinding->valid() ) $varBinding->rewind();
				$current = $varBinding->current();
			}
			if ( $current instanceof XPath2NodeIterator ) $current->Reset();
			$vars[ $bindingQName ] = $current;
			$vars = array_merge( $vars, $varBinding->getAdditionalVars() );
		}

		foreach( $this->generalVariableBindings as $bindingQName => /** @var VariableBinding $varBinding */ $varBinding )
		{
			// Using current makes sure the fact is set and the binding variables are correct
			// $vars[ $bindingQName ] = $this->variablesByQName[ $bindingQName ]->bindAsSequence ? $varBinding->facts : $varBinding->current();
			if ( ! $varBinding->valid() ) $varBinding->rewind();
			$current = $varBinding->current();
			if ( $current instanceof XPath2NodeIterator )
			{
				// BMS 2018-04-04 Test 0023 V-03 fails because the vars are being reset presumably because a var is not a clone
				$current = $current->CloneInstance();
				$current->Reset();
			}
			else if ( $current instanceof XPathNavigator)
			{
				$current = $current->CloneInstance();
			}
			$vars[ $bindingQName ] = $current;
		}

		return $vars;
	}
public function getBindingsAsVars ( $ vars = array ( ) ) { // $vars = array_merge( $existingVars, $this->parameters );
 $ vars = $ this -> getParametersAsVars ( $ vars ) ; foreach ( $ this -> factVariableBindings as $ bindingQName => /** @var \XBRL\Formulas\factVariableBinding $varBinding */ $ varBinding ) { if ( $ varBinding -> isFallback ) { $ current = $ varBinding -> yieldedFact ; } else { // Using current makes sure the fact is set and the binding variables are correct
 if ( ! $ varBinding -> valid ( ) ) $ varBinding -> rewind ( ) ; $ current = $ varBinding -> current ( ) ; } if ( $ current instanceof XPath2NodeIterator ) $ current -> Reset ( ) ; $ vars [ $ bindingQName ] = $ current ; $ vars = array_merge ( $ vars , $ varBinding -> getAdditionalVars ( ) ) ; } foreach ( $ this -> generalVariableBindings as $ bindingQName => /** @var VariableBinding $varBinding */ $ varBinding ) { // Using current makes sure the fact is set and the binding variables are correct
 // $vars[ $bindingQName ] = $this->variablesByQName[ $bindingQName ]->bindAsSequence ? $varBinding->facts : $varBinding->current();
 if ( ! $ varBinding -> valid ( ) ) $ varBinding -> rewind ( ) ; $ current = $ varBinding -> current ( ) ; if ( $ current instanceof XPath2NodeIterator ) { // BMS 2018-04-04 Test 0023 V-03 fails because the vars are being reset presumably because a var is not a clone
 $ current = $ current -> CloneInstance ( ) ; $ current -> Reset ( ) ; } else if ( $ current instanceof XPathNavigator ) { $ current = $ current -> CloneInstance ( ) ; } $ vars [ $ bindingQName ] = $ current ; } return $ vars ; }
Return an array of bound facts and parameters after the evaluation
@param array $vars (optional) An array of existing vars
@return array
Return an array of bound facts and parameters after the evaluation