protected function buildCallbackArguments(array $params, array $localVars)
	{
		// Remove 'parser' as a parameter, since there's no such thing in JavaScript
		unset($params['parser']);

		// Add global vars to the list of vars in scope
		$localVars += ['logger' => 1, 'openTags' => 1, 'registeredVars' => 1, 'text' => 1];

		$args = [];
		foreach ($params as $k => $v)
		{
			if (isset($v))
			{
				// Param by value
				$args[] = $this->encoder->encode($v);
			}
			elseif (isset($localVars[$k]))
			{
				// Param by name that matches a local var
				$args[] = $k;
			}
			else
			{
				$args[] = 'registeredVars[' . json_encode($k) . ']';
			}
		}

		return implode(',', $args);
	}
protected function buildCallbackArguments(array $params, array $localVars)
	{
		// Remove 'parser' as a parameter, since there's no such thing in JavaScript
		unset($params['parser']);

		// Add global vars to the list of vars in scope
		$localVars += ['logger' => 1, 'openTags' => 1, 'registeredVars' => 1, 'text' => 1];

		$args = [];
		foreach ($params as $k => $v)
		{
			if (isset($v))
			{
				// Param by value
				$args[] = $this->encoder->encode($v);
			}
			elseif (isset($localVars[$k]))
			{
				// Param by name that matches a local var
				$args[] = $k;
			}
			else
			{
				$args[] = 'registeredVars[' . json_encode($k) . ']';
			}
		}

		return implode(',', $args);
	}
protected function buildCallbackArguments ( array $ params , array $ localVars ) { // Remove 'parser' as a parameter, since there's no such thing in JavaScript unset ( $ params [ 'parser' ] ) ; // Add global vars to the list of vars in scope $ localVars += [ 'logger' => 1 , 'openTags' => 1 , 'registeredVars' => 1 , 'text' => 1 ] ; $ args = [ ] ; foreach ( $ params as $ k => $ v ) { if ( isset ( $ v ) ) { // Param by value $ args [ ] = $ this -> encoder -> encode ( $ v ) ; } elseif ( isset ( $ localVars [ $ k ] ) ) { // Param by name that matches a local var $ args [ ] = $ k ; } else { $ args [ ] = 'registeredVars[' . json_encode ( $ k ) . ']' ; } } return implode ( ',' , $ args ) ; }
Build the list of arguments used in a callback invocation

@param  array  $params    Callback parameters
@param  array  $localVars Known vars from the calling scope
@return string            JavaScript code
Build the list of arguments used in a callback invocation