src/bbn/parsers/doc.php
public function parse_docblock(string $block){
    $b = [
			'description' => '',
			'tags' => []
		];
    // Remove start pattern
    //$block = trim(substr($block, 3));
		// Remove end pattern
		$block = trim(substr($block, 0, strlen($block) - 2));
		// Tags
    $tags = $this->get_tags($block);
    foreach ( $tags as $i => $tag ){
			if (
				(
					isset($tags[$i+1]) &&
					($t = $this->parse_tag(substr($block, $tag[1], $tags[$i+1][1] - $tag[1])))
        ) ||
				($t = $this->parse_tag(substr($block, $tag[1])))
			){
				$b['tags'][] = $t;
			}
    }
    // Get Description
    $b['description'] = $this->clear_text(isset($tags[0]) ? substr($block, 3, $tags[0][1]-1) : substr($block, 3));
    return $b;
  }
public function parse_docblock(string $block){
    $b = [
			'description' => '',
			'tags' => []
		];
    // Remove start pattern
    //$block = trim(substr($block, 3));
		// Remove end pattern
		$block = trim(substr($block, 0, strlen($block) - 2));
		// Tags
    $tags = $this->get_tags($block);
    foreach ( $tags as $i => $tag ){
			if (
				(
					isset($tags[$i+1]) &&
					($t = $this->parse_tag(substr($block, $tag[1], $tags[$i+1][1] - $tag[1])))
        ) ||
				($t = $this->parse_tag(substr($block, $tag[1])))
			){
				$b['tags'][] = $t;
			}
    }
    // Get Description
    $b['description'] = $this->clear_text(isset($tags[0]) ? substr($block, 3, $tags[0][1]-1) : substr($block, 3));
    return $b;
  }
public function parse_docblock ( string $ block ) { $ b = [ 'description' => '' , 'tags' => [ ] ] ; // Remove start pattern //$block = trim(substr($block, 3)); // Remove end pattern $ block = trim ( substr ( $ block , 0 , strlen ( $ block ) - 2 ) ) ; // Tags $ tags = $ this -> get_tags ( $ block ) ; foreach ( $ tags as $ i => $ tag ) { if ( ( isset ( $ tags [ $ i + 1 ] ) && ( $ t = $ this -> parse_tag ( substr ( $ block , $ tag [ 1 ] , $ tags [ $ i + 1 ] [ 1 ] - $ tag [ 1 ] ) ) ) ) || ( $ t = $ this -> parse_tag ( substr ( $ block , $ tag [ 1 ] ) ) ) ) { $ b [ 'tags' ] [ ] = $ t ; } } // Get Description $ b [ 'description' ] = $ this -> clear_text ( isset ( $ tags [ 0 ] ) ? substr ( $ block , 3 , $ tags [ 0 ] [ 1 ] - 1 ) : substr ( $ block , 3 ) ) ; return $ b ; }
Parses a given docblock

@param string $block The docblock
@return array
Parses a given docblock