Skip to content

Commit 7dbeaf2

Browse files
authored
Update to PER CS coding style instead of PEAR (#167)
1 parent 1d0dd0d commit 7dbeaf2

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

docs/cs-for-examples.md

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ Examples need to be clear and simple, but should show the possibilities and
44
usage of the functions used. Only use OOP features where you would like to
55
present them, use simple functions in other areas.
66

7-
Examples should generally conform to the [PEAR coding standards][pear-cs].
8-
97
## Requirements
108

119
- When appropriate, use superglobals
1210
- Never generate PHP errors (`E_ALL|E_STRICT` friendly)
1311
- Be short and generic
14-
- Follow the PEAR coding standards
12+
- Follow the current [PHP-FIG PER Coding Style][per-cs]
1513

1614
## Program listing roles (`<programlisting role="xxx">`)
1715

@@ -200,15 +198,7 @@ echo "an {$array['key']} key";
200198
echo 'an ', $array['key'], ' key';
201199
```
202200

203-
## How to write...
204-
205-
### Control Structures
206-
207-
See PEAR coding standards
208-
209-
### Functions
210-
211-
#### Function naming
201+
## Function naming
212202

213203
Procedural function names should be lowercase. If multiple words are
214204
needed in the function name, use a `_` (also known as snake\_case).
@@ -217,17 +207,7 @@ Example: `foo_function();`
217207
OOP method names should follow the standard coding style which uses
218208
camelCase, such as `fooFunction()`.
219209

220-
#### Function calls
221-
#### Function definitions
222-
223-
See PEAR coding standards
224-
225-
### Comments
226-
### Example URLs/Emails
227-
228-
See PEAR coding standards
229-
230-
### Example output
210+
## Example output
231211

232212
For very short example printouts, use C++ style comment (`//`) on the
233213
line where the output occurs, or in the description above the line:
@@ -292,4 +272,4 @@ array(3) {
292272
</refsect1>
293273
```
294274

295-
[pear-cs]: http://pear.php.net/manual/en/standards.php
275+
[per-cs]: https://www.php-fig.org/per/coding-style/

0 commit comments

Comments
 (0)