Skip to content

Commit e54ca1c

Browse files
committed
Add a template for a class-description
1 parent 639c3d5 commit e54ca1c

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

Template.php

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?php declare(strict_types=1);
2+
3+
namespace Fig\Attributes;
4+
5+
/**
6+
* One-Line summary of what the attribute does
7+
*
8+
* Target audience
9+
* ---------------
10+
*
11+
* Implementors:
12+
* Who should handle this attribute? Example: "static analysis tools"
13+
* Users:
14+
* Who adds this attribute to their code? Example: "packages that want to
15+
* safeguard their functions via static analysis
16+
*
17+
* Long explanation of what the attribute does and why it is relevant.
18+
*
19+
* Use citations[1]_ or `Links <https://example.com>`_ in your text to make
20+
* sure people understand the relevance and where you got your ideas from.
21+
*
22+
* If your Attribute has preconditions for usage you MUST use the keywords
23+
* described in `RFC 2119 <https://datatracker.ietf.org/doc/html/rfc2119>`_.
24+
* You SHOULD list them prominently.
25+
*
26+
* .. hint::
27+
* You can add Content-Blocks according to the `Sphinx ReST Cheatsheet`_
28+
*
29+
* .. important::
30+
* Feel free to use ReST **or** Markdown for this description.
31+
*
32+
* Please also use code-snippets where appropriate
33+
*
34+
* .. codeblock:: php
35+
* :linenos: true
36+
* :caption: A simple hello world
37+
*
38+
* <?php
39+
* echo 'Hello World';
40+
*
41+
* You MUST describe parameters to your Attribute extensively!
42+
* You can either use ReST or Annotations for that
43+
*
44+
* .. example::
45+
* :param $example_1: ``string`` does x and y
46+
* :param $example_2: ``boolean``
47+
*
48+
* .. example::
49+
* @param string $example_1 Does x and y
50+
* @param boolean $example_2
51+
*
52+
* .. [1] https://en.wikipedia.org/wiki/Citation
53+
* .. _Sphinx ReST Cheatsheet: https://sphinx-tutorial.readthedocs.io/cheatsheet/
54+
*/
55+
#[\Attribute(\Attribute::TARGET_CLASS)]
56+
final class Template {}

0 commit comments

Comments
 (0)