/** * Gets the meta information for a file element e.g. description * * @param string $file_content * * @return array */ private function get_file_element_meta($file_content) { $meta = array(); $comments = FileHelper::get_file_doc_comments($file_content); foreach ($comments as $comment) { $comment_lines = explode("\n", $comment); foreach ($comment_lines as $comment_line) { if (preg_match('/@Description (.*)/', $comment_line, $match)) { $meta['description'] = trim($match[1]); } } } return $meta; }