TAILIEUCHUNG - php objects patterns and practice 3rd edition phần 8

Download được định nghĩa bằng cách sử dụng các dấu hiệu (@) và có thể được liên kết với các đối số. Vì vậy, các DocBlock sau đây được đặt ở đầu của một lớp cho phpDocumentor gói mà nó thuộc về: / ** * @ gói lệnh * / Nếu tôi thêm bình luận này để mọi tầng lớp trong dự án của tôi (với tên gói thích hợp, tất nhiên) | CHAPTER 16 GENERATING DOCUMENTATION WITH PHPDOCUMENTOR property . It also includes special keywords called tags. Tags are defined using the at sign @ and may be associated with arguments. So the following DocBlock placed at the top of a class tells phpDocumentor the package to which it belongs @package command If I add this comment to every class in my project with the appropriate package name of course phpDocumentor will organize our classes for us. You can see phpDocumentor output that includes packages in Figure 16-3. Figure 16-3. Documentation output that recognizes the @package tag In Figure 16-3 notice that packages have been added to the navigation top-right corner . In addition to the default megaquiz package I defined as a command line switch I can now click command or quiztools. Because I am currently examining classes in the command package the links that form the lefthand navigation list only those classes. Generally packages in documentation will mirror your directory structure. So the command package maps to a command directory. That isn t necessary however. A third-party developer may wish to create a Command class that is part of the command package but lives in her own directory for example. So the @package tag makes you take responsibility for associating classes with packages but it also affords you flexibility that would not be available by using the file system to guess at package names. 351 CHAPTER 16 GENERATING DOCUMENTATION WITH PHPDOCUMENTOR Documenting Classes Let s add some more tags and text that are useful in class- or file-level DocBlocks. I should identify the class explain its uses and add authorship and copyright information. Here is the Command class in its entirety Defines core functionality for commands. Command classes perform specific tasks in a system via the execute method @package command @author Clarrie Grundie @copyright 2004 Ambridge Technologies Ltd abstract class Command abstract function execute CommandContext context

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.