-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DRAFT, WIP] PSR-5: PHPDoc Standard #169
Changes from 24 commits
796b9d9
1572a8b
ad2a261
853f44b
6d1451d
fc11367
27d90d3
e5097b4
5c56bd9
99dad5c
f8d5382
cb518e8
7b41a17
87623ec
2b4ff37
c640add
b3c9f8a
9b232fb
761afeb
a7c09ca
1853628
2d6149d
dd20d56
8556da6
9748de1
a0f9141
0e75d8a
b26791d
ff1ae19
1b68927
f717b2b
31d593c
7b822dd
c54bc1f
36e82be
365d1a1
1d6b650
eac8337
78c73ec
0f90737
2e1b505
520e410
1df2582
065e65b
44519fd
051d5f9
8fe3d42
db15c21
cbf58ef
ed9e863
a3dacae
f001ebe
4319c6c
68bc885
604e15c
8e272d4
f9fccfa
adc0241
d44d6c7
40f9b13
1d07566
61c695c
a015038
1d20343
4f4b640
8a6a2ff
ca1477e
30fdbb2
4f588d7
5317d4f
eda5e92
0633623
143e8d8
a63e95f
04b3e73
f650a15
6861e37
46e4e4e
b3f503f
e287633
0379e00
5f209f9
38222fe
b293909
5b68085
d6b9e48
eca33f8
2726c89
d486bad
b55176c
63af227
da00906
d27159e
8abaef4
e8ae204
695b38a
3b425d1
ead19fb
b994d85
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
PHPDoc Meta Document | ||
==================== | ||
|
||
1. Summary | ||
---------- | ||
|
||
The purpose of documentation using PHPDoc is to provide a comprehensive but flexible way to describe a software system | ||
at the smallest possible level of detail. This type of documentation aids contributors and consumers of your source | ||
code to, for example, understand what type of information needs to be passed to specific methods, or how to be able to | ||
consume a class of the project that a consumer want to use. | ||
|
||
By documenting specific elements inside the source code the documentation for that part of the source code will be less | ||
susceptible to becoming out of date. | ||
|
||
PHPDoc as a notation has existed for more than ten years now, is heavily inspired by JavaDoc, and is currently in use by a | ||
significant percentage of public PHP projects in the field. | ||
|
||
2. Why Bother? | ||
-------------- | ||
|
||
PHPDocumentor has spearheaded and facilitated the growth of the PHPDoc notation, but with the growing number of other | ||
tools that use the PHPDoc notation, it is becoming increasingly important to have an official and formal standard | ||
instead of the de-facto status that is currently provided. | ||
|
||
An additional goal for this PSR is to deprecate obsolete elements and introduce new concepts and syntaxes to reflect the | ||
current status of the PHP language, and to facilitate best practices and design patterns in use today and in the | ||
foreseeable future. | ||
|
||
Pros: | ||
|
||
* Developers (consumers) have a common reference to refer to when confronted with PHPDoc. | ||
* Projects and their Developers (contributors) have an authoritative reference which they can consult. | ||
* IDE vendors can standardize the way they use PHPDoc to aid in concerns such as auto-completion and navigation. | ||
* Projects using the PHPDoc data to complement their functionality, such as Documentation generators or applications | ||
using annotations, will have a common language with their consumers. | ||
* Missing functionality can be described and implemented by aforementioned stakeholders. | ||
|
||
Cons: | ||
|
||
* If there are different uses of elements in the PHPDoc notation, then it is desirable for projects to align with this | ||
specification, which will cost effort to introduce. | ||
* Deprecation of well-known PHPDoc elements may lead to a period of confusion or resistance to the proposed changes. It | ||
is for this reason that concepts are deprecated and not removed. | ||
* Given the age of the current standard and widespread adoption, it is not possible to introduce significant breaks in | ||
backwards compatibility with the current practices without a significant risk of alienating existing users or vendors. | ||
|
||
3. Scope | ||
-------- | ||
|
||
## 3.1 Goals | ||
|
||
* Provide a complete technical definition, or schema, of the PHPDoc notation. | ||
* Introduce new concepts matching best practices or design patterns in use today and in the foreseeable future. | ||
* Deprecate old concepts that are replaced by newer concepts or are no longer in use in today's PHP landscape. | ||
|
||
## 3.2 Non-Goals | ||
|
||
* This PSR does not provide a recommendation on how and when to use the concepts described in this document, | ||
so it is not a coding standard. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. However, at least one place in this document (@return section), it says what individual projects can and can't do in their coding standards, so I think this statement is kind of misleading? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At best the statement in the 'This Standard is not a Coding Standard but a Technical description of a DSL' is one of the most important goals for this document. |
||
* This PSR facilitates the creation of annotations by allowing the notation needed for Symfony/Doctrine style | ||
annotations, but does not describe a style of annotations or which "defined annotations" exist in use. The concept of annotations is only | ||
alluded to and is out of scope for this PSR. | ||
|
||
4. Approaches | ||
------------- | ||
|
||
### 4.1 Chosen Approach | ||
|
||
We have decided to formalize the existing practices, observe non-documented usages (such as Doctrine-style | ||
annotations), and observe feature requests with Documentation generators (such as phpDocumentor). | ||
|
||
The combination of these should be described in sufficient detail as to reduce the amount of possible interpretation. | ||
|
||
In addition to the above, the authors have taken care to provide for future expansions and tag additions that do not | ||
affect the Syntax of PHPDoc itself. | ||
|
||
Pros: | ||
|
||
* Delivers a machine-parsable and verifyable specification. | ||
* Well-rounded proposal due to the number of factors considered. | ||
|
||
Cons: | ||
|
||
* Technical and verbose. | ||
* Can only be extended when the syntax is not affected. | ||
|
||
5. People | ||
--------- | ||
|
||
### 5.1 Editor(s) | ||
|
||
* Mike van Riel | ||
|
||
### 5.2 Sponsors | ||
|
||
* Phil Sturgeon | ||
* Donald Gilbert | ||
|
||
### 5.3 Contributors | ||
|
||
* Chuck Burgess | ||
* Gary Jones | ||
|
||
6. Votes | ||
-------- | ||
|
||
* **Entrance Vote: ** TBD | ||
* **Acceptance Vote:** TBD | ||
|
||
7. Relevant Links | ||
----------------- | ||
|
||
Most of the relevant links are mentioned in the PSR itself as support for individual chapters. | ||
|
||
_**Note:** Order descending chronologically._ | ||
|
||
* [Original draft](https://github.com/phpDocumentor/phpDocumentor2/commit/0dbdbfa318d197279b414e5c0d1ffb142b31a528#docs/PSR.md) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Grammar: which -> that in this line