private function parseLine( $line, $info ) 
	{
		$handled = false;
		if (preg_match('/^\s*(@[a-z]+)\s(.*)$/i', $line, $matches)) 
		{
			$this->currentTag = substr($matches[1], 1);
			$line = trim( substr($line, strlen($this->currentTag)+2 ) );
			switch( $this->currentTag ) 
			{
				case 'param' :
					if ( preg_match('/^\s*([[:alpha:]|]+)\s([[:alnum:]$_]+)(.*)$/i', $line, $matches) ) 
					{
						if ( !isset($info['arguments']) ) {
							$info['arguments'] = array();
						}
						if ( !isset($info['arguments'][$matches[2]]) ) {
							$info['arguments'][$matches[2]] = array('description' => '');
						}
						$info['arguments'][$matches[2]]['type'] = $matches[1];
						$info['arguments'][$matches[2]]['description'] .= $this->parseDescription($matches[3]);
					}
					$handled = true;
				break;
				case 'return' :
					if ( preg_match('/^\s*([[:alpha:]|]+)\s(.*)$/i', $line, $matches) ) 
					{
						if ( !isset($info['return']) ) {
							$info['return'] = array( 'description' => '' );
						}
						$info['return']['type'] = $matches[1];
						$info['return']['description'] .= $this->parseDescription($matches[2]);
					}
					$handled = true;
				break;
			}
		}
		if (!$handled) {
			switch( $this->currentTag) {
				case 'param' :
				case 'return' :
					if ( !isset( $info[$this->currentTag] ) ) {
						$info[$this->currentTag] = array();
					}
					$info[$this->currentTag]['description'] .= $this->parseDescription($line);
				break;
				default:
					if ( !isset( $info[$this->currentTag] ) ) {
						$info[$this->currentTag] = '';
					}
					$info[$this->currentTag] .= $this->parseDescription($line);
				break;
			}
		}
		return $info;
	}
private function parseLine( $line, $info ) 
	{
		$handled = false;
		if (preg_match('/^\s*(@[a-z]+)\s(.*)$/i', $line, $matches)) 
		{
			$this->currentTag = substr($matches[1], 1);
			$line = trim( substr($line, strlen($this->currentTag)+2 ) );
			switch( $this->currentTag ) 
			{
				case 'param' :
					if ( preg_match('/^\s*([[:alpha:]|]+)\s([[:alnum:]$_]+)(.*)$/i', $line, $matches) ) 
					{
						if ( !isset($info['arguments']) ) {
							$info['arguments'] = array();
						}
						if ( !isset($info['arguments'][$matches[2]]) ) {
							$info['arguments'][$matches[2]] = array('description' => '');
						}
						$info['arguments'][$matches[2]]['type'] = $matches[1];
						$info['arguments'][$matches[2]]['description'] .= $this->parseDescription($matches[3]);
					}
					$handled = true;
				break;
				case 'return' :
					if ( preg_match('/^\s*([[:alpha:]|]+)\s(.*)$/i', $line, $matches) ) 
					{
						if ( !isset($info['return']) ) {
							$info['return'] = array( 'description' => '' );
						}
						$info['return']['type'] = $matches[1];
						$info['return']['description'] .= $this->parseDescription($matches[2]);
					}
					$handled = true;
				break;
			}
		}
		if (!$handled) {
			switch( $this->currentTag) {
				case 'param' :
				case 'return' :
					if ( !isset( $info[$this->currentTag] ) ) {
						$info[$this->currentTag] = array();
					}
					$info[$this->currentTag]['description'] .= $this->parseDescription($line);
				break;
				default:
					if ( !isset( $info[$this->currentTag] ) ) {
						$info[$this->currentTag] = '';
					}
					$info[$this->currentTag] .= $this->parseDescription($line);
				break;
			}
		}
		return $info;
	}
private function parseLine ( $ line , $ info ) { $ handled = false ; if ( preg_match ( '/^\s*(@[a-z]+)\s(.*)$/i' , $ line , $ matches ) ) { $ this -> currentTag = substr ( $ matches [ 1 ] , 1 ) ; $ line = trim ( substr ( $ line , strlen ( $ this -> currentTag ) + 2 ) ) ; switch ( $ this -> currentTag ) { case 'param' : if ( preg_match ( '/^\s*([[:alpha:]|]+)\s([[:alnum:]$_]+)(.*)$/i' , $ line , $ matches ) ) { if ( ! isset ( $ info [ 'arguments' ] ) ) { $ info [ 'arguments' ] = array ( ) ; } if ( ! isset ( $ info [ 'arguments' ] [ $ matches [ 2 ] ] ) ) { $ info [ 'arguments' ] [ $ matches [ 2 ] ] = array ( 'description' => '' ) ; } $ info [ 'arguments' ] [ $ matches [ 2 ] ] [ 'type' ] = $ matches [ 1 ] ; $ info [ 'arguments' ] [ $ matches [ 2 ] ] [ 'description' ] .= $ this -> parseDescription ( $ matches [ 3 ] ) ; } $ handled = true ; break ; case 'return' : if ( preg_match ( '/^\s*([[:alpha:]|]+)\s(.*)$/i' , $ line , $ matches ) ) { if ( ! isset ( $ info [ 'return' ] ) ) { $ info [ 'return' ] = array ( 'description' => '' ) ; } $ info [ 'return' ] [ 'type' ] = $ matches [ 1 ] ; $ info [ 'return' ] [ 'description' ] .= $ this -> parseDescription ( $ matches [ 2 ] ) ; } $ handled = true ; break ; } } if ( ! $ handled ) { switch ( $ this -> currentTag ) { case 'param' : case 'return' : if ( ! isset ( $ info [ $ this -> currentTag ] ) ) { $ info [ $ this -> currentTag ] = array ( ) ; } $ info [ $ this -> currentTag ] [ 'description' ] .= $ this -> parseDescription ( $ line ) ; break ; default : if ( ! isset ( $ info [ $ this -> currentTag ] ) ) { $ info [ $ this -> currentTag ] = '' ; } $ info [ $ this -> currentTag ] .= $ this -> parseDescription ( $ line ) ; break ; } } return $ info ; }
This method parses a single line from the comment block.
This method parses a single line from the comment block .