Pro PHP- Patterns, Frameworks, Testing and More

(vip2019) #1
CHAPTER 6 ■ DOCUMENTATION AND CODING CONVENTIONS^71

There are literally hundreds of possible tags, and these are just the most common. Again,
refer to the DocBook documentation for more details.

Just the Facts


In this chapter, you learned a lot about documentation. You learned that documentation is not
only important for communicating ideas to other programmers, but can also be used for adding
metadata to your applications.
You can use in-line, multiline, and doccomments comments in your code. Only doccom-
ments are stored after lexing, and this is important for accessing the information
programmatically.
PHPDoc is a way to embed metadata within your applications. The PHPDoc format is a
standard in PHP documentation. Many PHPDoc tags are available, and you can also create
your own tags. You will learn how to use PHPDoc information in the next chapter.
The DocBook standard is a comprehensive XML-based documentation type that defines
the data markup for programming manuals. Its design is more focused on creating actual books,
rather than commenting code within the program.
The next chapter covers the reflection API. In that chapter, you will build a reflection-based
documentation parser using the doccomments that you learned about in this chapter.

McArthur_819-9C06.fm Page 71 Friday, February 22, 2008 8:59 AM

Free download pdf