src/classes/CCError/Trace.php
public function reflection_function_info( $function = null )
	{	
		if ( is_null( $lines = $this->reflection_file() ) )
		{
			return null;
		}
		
		if ( is_null( $function ) )
		{
			if ( is_null( $function = $this->function_name() ) )
			{
				return null;
			}
		}
		
		$info = array(
			'message'	=> '',
		);
		
		foreach( $lines as $index => $line )
		{
			// is this the function define
			if ( strpos( $line, 'function '.$function ) !== false )
			{
				// do we have a comment on top
				if ( substr( trim( $lines[$index-1] ), 0, 1 ) === '*' )
				{
					$start = $index-1;
					$comment = array();
					
					// parse the comment
					while( $start > 0 && substr( trim( $lines[$start-1] ), 0, 1 ) === '*' )
					{
						$start--; array_unshift( $comment, substr( trim( trim( $lines[$start] ), "*" ), 1 ) );
					}
					
					// parse quotse
					$in_quote = false;
					
					// we got a comment
					foreach( $comment as $line )
					{
						// add param
						if ( strpos( $line, '@' ) !== false )
						{
							// replace double tabs
							$line = preg_replace( "!\t+!", "\t", $line );
							// make tabs to spaces
							$line = str_replace( "\t", '    ', $line );
							
							$info[trim(substr( $line, 1, strpos( $line, ' ' ) ))][] = trim( substr( $line, strpos( $line, ' ' ) ) );
						}
						// add message
						else
						{
							$line = str_replace( "\t", '    ', $line );
							
							if ( substr( $line, 0, 4 ) == '    ' && !$in_quote )
							{
								$info['message'] .= "<pre>";
								$in_quote = true;
							}
							elseif ( substr( $line, 0, 4 ) != '    ' && $in_quote )
							{
								$info['message'] .= "</pre>";
								$in_quote = false;
							}
							
							if ( $in_quote )
							{
								$line = substr( $line, 4 );
							}
							
							$info['message'] .= $line."\n";
						}
					}
					
					// final trim
					$info['message'] = trim( $info['message'], "\n\r\t" );
					
					// done;
					return $info;
				}
				continue;
			}
		}
	}
public function reflection_function_info( $function = null )
	{	
		if ( is_null( $lines = $this->reflection_file() ) )
		{
			return null;
		}
		
		if ( is_null( $function ) )
		{
			if ( is_null( $function = $this->function_name() ) )
			{
				return null;
			}
		}
		
		$info = array(
			'message'	=> '',
		);
		
		foreach( $lines as $index => $line )
		{
			// is this the function define
			if ( strpos( $line, 'function '.$function ) !== false )
			{
				// do we have a comment on top
				if ( substr( trim( $lines[$index-1] ), 0, 1 ) === '*' )
				{
					$start = $index-1;
					$comment = array();
					
					// parse the comment
					while( $start > 0 && substr( trim( $lines[$start-1] ), 0, 1 ) === '*' )
					{
						$start--; array_unshift( $comment, substr( trim( trim( $lines[$start] ), "*" ), 1 ) );
					}
					
					// parse quotse
					$in_quote = false;
					
					// we got a comment
					foreach( $comment as $line )
					{
						// add param
						if ( strpos( $line, '@' ) !== false )
						{
							// replace double tabs
							$line = preg_replace( "!\t+!", "\t", $line );
							// make tabs to spaces
							$line = str_replace( "\t", '    ', $line );
							
							$info[trim(substr( $line, 1, strpos( $line, ' ' ) ))][] = trim( substr( $line, strpos( $line, ' ' ) ) );
						}
						// add message
						else
						{
							$line = str_replace( "\t", '    ', $line );
							
							if ( substr( $line, 0, 4 ) == '    ' && !$in_quote )
							{
								$info['message'] .= "<pre>";
								$in_quote = true;
							}
							elseif ( substr( $line, 0, 4 ) != '    ' && $in_quote )
							{
								$info['message'] .= "</pre>";
								$in_quote = false;
							}
							
							if ( $in_quote )
							{
								$line = substr( $line, 4 );
							}
							
							$info['message'] .= $line."\n";
						}
					}
					
					// final trim
					$info['message'] = trim( $info['message'], "\n\r\t" );
					
					// done;
					return $info;
				}
				continue;
			}
		}
	}
public function reflection_function_info ( $ function = null ) { if ( is_null ( $ lines = $ this -> reflection_file ( ) ) ) { return null ; } if ( is_null ( $ function ) ) { if ( is_null ( $ function = $ this -> function_name ( ) ) ) { return null ; } } $ info = array ( 'message' => '' , ) ; foreach ( $ lines as $ index => $ line ) { // is this the function define if ( strpos ( $ line , 'function ' . $ function ) !== false ) { // do we have a comment on top if ( substr ( trim ( $ lines [ $ index - 1 ] ) , 0 , 1 ) === '*' ) { $ start = $ index - 1 ; $ comment = array ( ) ; // parse the comment while ( $ start > 0 && substr ( trim ( $ lines [ $ start - 1 ] ) , 0 , 1 ) === '*' ) { $ start -- ; array_unshift ( $ comment , substr ( trim ( trim ( $ lines [ $ start ] ) , "*" ) , 1 ) ) ; } // parse quotse $ in_quote = false ; // we got a comment foreach ( $ comment as $ line ) { // add param if ( strpos ( $ line , '@' ) !== false ) { // replace double tabs $ line = preg_replace ( "!\t+!" , "\t" , $ line ) ; // make tabs to spaces $ line = str_replace ( "\t" , '    ' , $ line ) ; $ info [ trim ( substr ( $ line , 1 , strpos ( $ line , ' ' ) ) ) ] [ ] = trim ( substr ( $ line , strpos ( $ line , ' ' ) ) ) ; } // add message else { $ line = str_replace ( "\t" , '    ' , $ line ) ; if ( substr ( $ line , 0 , 4 ) == '    ' && ! $ in_quote ) { $ info [ 'message' ] .= "<pre>" ; $ in_quote = true ; } elseif ( substr ( $ line , 0 , 4 ) != '    ' && $ in_quote ) { $ info [ 'message' ] .= "</pre>" ; $ in_quote = false ; } if ( $ in_quote ) { $ line = substr ( $ line , 4 ) ; } $ info [ 'message' ] .= $ line . "\n" ; } } // final trim $ info [ 'message' ] = trim ( $ info [ 'message' ] , "\n\r\t" ) ; // done; return $ info ; } continue ; } } }
get the source code where the trace happend

@return string
get the source code where the trace happend