» Metadata | » Status |
---|---|
|
|
» Description | |
ProblemThe current "Header Comment Blocks" portion of the Coding Standards was basically copied from PHP sources without alteration. Those headers are often construed to indicate that the license summary for the PHP License and the PHP Group copyright must be included in each file, even if a different license and/or copyright are used. In addition, the header comments aren't parseable by phpDocumentor. SolutionThe following text shall become the new PEAR coding standard for header comment blocks. =========================================== New TextAll source code files in the PEAR repository shall contain a "page-level" docblock at the top of each file and a "class-level" docblock immediately above each class. Below are examples of such docblocks.
Required But VariableShort DescriptionsShort descriptions must be provided for all docblocks. They should be a quick sentence, not the name of the item. Please read the Coding Standard's sample file about how to write good descriptions. PHP VersionsOne of the following must go in the page-level docblock:
@licenseThere are several possible licenses. One of the following must be picked and placed in the page-level and class-level docblocks:
For more information, see the PEAR Group's Licensing Announcement: @linkThe following must be used in both the page-level and class-level docblocks. Of course, change "PackageName" to the name of your package. This ensures the generated documentation links back your package.
@authorThere's no hard rule to determine when a new code contributor should be added to the list of authors for a given source file. In general, their changes should fall into the "substantial" category (meaning somewhere around 10% to 20% of code changes). Exceptions could be made for rewriting functions or contributing new logic. Simple code reorganization or bug fixes would not justify the addition of a new individual to the list of authors. @sinceThis tag is required when a file or class is added after the package's initial release. Do not use it in an initial release. @deprecatedThis tag is required when a file or class is no longer used but has been left in place for backwards compatibility. Optional@copyrightFeel free to apply whatever copyrights you desire. When formatting this tag, the year should be in four digit format and if a span of years is involved, use a hyphen between the earliest and latest year. The copyright holder can be you, a list of people, a company, the PHP Group, etc. Examples:
License SummaryIf you are using the PHP License, use the summary text provided above. If another license is being used, please remove the PHP License summary. Feel free to substitute it with text appropriate to your license, though to keep things easy to locate, please preface the text with "LICENSE: ". @seeAdd a @see tag when you want to refer users to other sections of the package's documentation. If you have multiple items, separate them with commas rather than adding multiple @see tags. Order and SpacingTo ease long term readability of PEAR source code, the text and tags must conform to the order and spacing provided in the example above. This standard is adopted from the JavaDoc standard. @package_version@ UsageThere are two ways to implement the @package_version@ replacements. The procedure depends on whether you write your own package.xml files or if you use the PackageFileManager. For those authoring package.xml files directly, add a <replace> element for each file. The XML for such would look something like this:
Maintainers using the PackageFileManager need to call addReplacement() for each file:
Transition PolicyExisting Small PackagesExisting packages that have only a few files are required to adopt these docblocks before the next release. Existing Large PackagesExisting packages with many files are encouraged to adopt the new headers as soon as possible. When such packages come out with a new major version upgrade, these docblocks must be implemented therein. New PackagesNew packages and existing packages which have no releases yet must include these docblocks before their first release. =========================================== Comments on the pear-dev Mailing List Regarding This RFC
|
|
» Dependencies | » Links |
|
|
» Timeline | » Changelog |
|
|