Skip to main content

find_tag

Function find_tag 

Source
pub fn find_tag<'d>(doc: &'d PhpDoc, name: &str) -> Option<&'d PhpDocTag>
Expand description

Find the first tag with the given name.

ยงExample

use phpdoc_parser::{parse, find_tag};
let doc = parse("/** @param int $x @return string */");
assert!(find_tag(&doc, "param").is_some());
assert!(find_tag(&doc, "throws").is_none());