public function append($data)
	{
		if($data instanceof AbstractToken)
		{
			$this->tokens[] = $data;
		}
		elseif($data instanceof AbstractTokenContainer)
		{
			$this->tokens = array_merge($this->tokens, $data->toArray());
		}
		elseif($data instanceof AbstractTokenCursor)
		{
			while($data->valid())
			{
				$this->tokens[] = $data->current();
				
				$data->next();
			}
		}
		else
		{
			throw new \InvalidArgumentException('Cannot append data to token buffer: ' . gettype($data));
		}
		
		return $this;
	}
public function append($data)
	{
		if($data instanceof AbstractToken)
		{
			$this->tokens[] = $data;
		}
		elseif($data instanceof AbstractTokenContainer)
		{
			$this->tokens = array_merge($this->tokens, $data->toArray());
		}
		elseif($data instanceof AbstractTokenCursor)
		{
			while($data->valid())
			{
				$this->tokens[] = $data->current();
				
				$data->next();
			}
		}
		else
		{
			throw new \InvalidArgumentException('Cannot append data to token buffer: ' . gettype($data));
		}
		
		return $this;
	}
public function append ( $ data ) { if ( $ data instanceof AbstractToken ) { $ this -> tokens [ ] = $ data ; } elseif ( $ data instanceof AbstractTokenContainer ) { $ this -> tokens = array_merge ( $ this -> tokens , $ data -> toArray ( ) ) ; } elseif ( $ data instanceof AbstractTokenCursor ) { while ( $ data -> valid ( ) ) { $ this -> tokens [ ] = $ data -> current ( ) ; $ data -> next ( ) ; } } else { throw new \ InvalidArgumentException ( 'Cannot append data to token buffer: ' . gettype ( $ data ) ) ; } return $ this ; }
Append the given token or token container to the TokenBuffer.

@param mixed $data
@return AbstractTokenBuffer

@throws \InvalidArgumentException
Append the given token or token container to the TokenBuffer .