Skip to content

Commit f5242af

Browse files
committed
[skip-ci] Minor Markdown and typo fixes
Fixes a few typo and Markdown list numbering patterns in `CODING_STANDARDS.md`, `CONTRIBUTING.md`, and `UPGRADING` files
1 parent 63a7f22 commit f5242af

File tree

3 files changed

+29
-29
lines changed

3 files changed

+29
-29
lines changed

CODING_STANDARDS.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ rewritten to comply with these rules.
99

1010
1. Document your code in source files and the manual. (tm)
1111

12-
1. PHP is implemented in C99. The optional fixed-width integers from
12+
2. PHP is implemented in C99. The optional fixed-width integers from
1313
stdint.h (int8_t, int16_t, int32_t, int64_t and their unsigned
1414
counterparts) must be available.
1515

16-
1. Functions that are given pointers to resources should not free them.
16+
3. Functions that are given pointers to resources should not free them.
1717

1818
For instance, `function int mail(char *to, char *from)` should NOT free `to`
1919
and/or `from`.
@@ -30,42 +30,42 @@ rewritten to comply with these rules.
3030
* Low-level parser routines, that are tightly integrated with the token
3131
cache and the bison code for minimum memory copying overhead.
3232

33-
1. Functions that are tightly integrated with other functions within the same
33+
4. Functions that are tightly integrated with other functions within the same
3434
module, and rely on each other's non-trivial behavior, should be documented as
3535
such and declared `static`. They should be avoided if possible.
3636

37-
1. Use definitions and macros whenever possible, so that constants have
37+
5. Use definitions and macros whenever possible, so that constants have
3838
meaningful names and can be easily manipulated. Any use of a numeric
3939
constant to specify different behavior or actions should be done through
4040
a `#define`.
4141

42-
1. When writing functions that deal with strings, be sure to remember that PHP
42+
6. When writing functions that deal with strings, be sure to remember that PHP
4343
holds the length property of each string, and that it shouldn't be
4444
calculated with `strlen()`. Write your functions in such a way so that
4545
they'll take advantage of the length property, both for efficiency and in
4646
order for them to be binary-safe. Functions that change strings and obtain
4747
their new lengths while doing so, should return that new length, so it
4848
doesn't have to be recalculated with `strlen()` (e.g. `php_addslashes()`).
4949

50-
1. NEVER USE `strncat()`. If you're absolutely sure you know what you're doing,
50+
7. NEVER USE `strncat()`. If you're absolutely sure you know what you're doing,
5151
check its man page again, and only then, consider using it, and even then,
5252
try avoiding it.
5353

54-
1. Use `PHP_*` macros in the PHP source, and `ZEND_*` macros in the Zend part of
54+
8. Use `PHP_*` macros in the PHP source, and `ZEND_*` macros in the Zend part of
5555
the source. Although the `PHP_*` macros are mostly aliased to the `ZEND_*`
5656
macros it gives a better understanding on what kind of macro you're calling.
5757

58-
1. When commenting out code using a `#if` statement, do NOT use `0` only.
58+
9. When commenting out code using a `#if` statement, do NOT use `0` only.
5959
Instead, use `"<git username here>_0"`. For example, `#if FOO_0`,
6060
where `FOO` is your git user `foo`. This allows easier tracking of why
6161
code was commented out, especially in bundled libraries.
6262

63-
1. Do not define functions that are not available. For instance, if a library is
63+
10. Do not define functions that are not available. For instance, if a library is
6464
missing a function, do not define the PHP version of the function, and do
6565
not raise a run-time error about the function not existing. End users should
6666
use `function_exists()` to test for the existence of a function.
6767

68-
1. Prefer `emalloc()`, `efree()`, `estrdup()`, etc. to their standard C library
68+
11. Prefer `emalloc()`, `efree()`, `estrdup()`, etc. to their standard C library
6969
counterparts. These functions implement an internal "safety-net" mechanism
7070
that ensures the deallocation of any unfreed memory at the end of a request.
7171
They also provide useful allocation and overflow information while running
@@ -78,7 +78,7 @@ rewritten to comply with these rules.
7878
may need to control or free the memory, or when the memory in question needs
7979
to survive between multiple requests.
8080

81-
1. The return type of "is" or "has" style functions should be `bool`,
81+
12. The return type of "is" or "has" style functions should be `bool`,
8282
which return a "yes"/"no" answer. `zend_result` is an appropriate
8383
return value for functions that perform some operation that may
8484
succeed or fail.
@@ -115,7 +115,7 @@ rewritten to comply with these rules.
115115
jf_n_s_i
116116
```
117117

118-
1. If they are part of a "parent set" of functions, that parent should be
118+
2. If they are part of a "parent set" of functions, that parent should be
119119
included in the user function name, and should be clearly related to the
120120
parent program or function family. This should be in the form of `parent_*`:
121121

@@ -137,19 +137,19 @@ rewritten to comply with these rules.
137137
delete_foo_baz
138138
```
139139

140-
1. Function names used by user functions should be prefixed with `_php_`, and
140+
3. Function names used by user functions should be prefixed with `_php_`, and
141141
followed by a word or an underscore-delimited list of words, in lowercase
142142
letters, that describes the function. If applicable, they should be declared
143143
`static`.
144144

145-
1. Variable names must be meaningful. One letter variable names must be avoided,
145+
4. Variable names must be meaningful. One letter variable names must be avoided,
146146
except for places where the variable has no real meaning or a trivial
147147
meaning (e.g. `for (i=0; i<100; i++) ...`).
148148

149-
1. Variable names should be in lowercase. Use underscores to separate between
149+
5. Variable names should be in lowercase. Use underscores to separate between
150150
words.
151151

152-
1. Method names follow the *studlyCaps* (also referred to as *bumpy case* or
152+
6. Method names follow the *studlyCaps* (also referred to as *bumpy case* or
153153
*camel caps*) naming convention, with care taken to minimize the letter
154154
count. The initial letter of the name is lowercase, and each letter that
155155
starts a new `word` is capitalized:
@@ -170,7 +170,7 @@ rewritten to comply with these rules.
170170
getI()
171171
```
172172

173-
1. Class names should be descriptive nouns in *PascalCase* and as short as
173+
7. Class names should be descriptive nouns in *PascalCase* and as short as
174174
possible. Each word in the class name should start with a capital letter,
175175
without underscore delimiters. The class name should be prefixed with the
176176
name of the "parent set" (e.g. the name of the extension) if no namespaces
@@ -228,9 +228,9 @@ rewritten to comply with these rules.
228228
static int php_session_destroy()
229229
```
230230

231-
1. Main module source file must be named `modulename.c`.
231+
2. Main module source file must be named `modulename.c`.
232232

233-
1. Header file that is used by other sources must be named `php_modulename.h`.
233+
3. Header file that is used by other sources must be named `php_modulename.h`.
234234

235235
## Syntax and indentation
236236

@@ -241,7 +241,7 @@ rewritten to comply with these rules.
241241
indentation and comment styles and up to function declaration syntax. Also
242242
see [Indentstyle](http://www.catb.org/~esr/jargon/html/I/indent-style.html).
243243

244-
1. Be generous with whitespace and braces. Keep one empty line between the
244+
2. Be generous with whitespace and braces. Keep one empty line between the
245245
variable declaration section and the statements in a block, as well as
246246
between logical statement groups in a block. Maintain at least one empty
247247
line between two functions, preferably two. Always prefer:
@@ -258,15 +258,15 @@ rewritten to comply with these rules.
258258
if(foo)bar;
259259
```
260260

261-
1. When indenting, use the tab character. A tab is expected to represent four
261+
3. When indenting, use the tab character. A tab is expected to represent four
262262
spaces. It is important to maintain consistency in indentation so that
263263
definitions, comments, and control structures line up correctly.
264264

265-
1. Preprocessor statements (`#if` and such) MUST start at column one. To indent
265+
4. Preprocessor statements (`#if` and such) MUST start at column one. To indent
266266
preprocessor directives you should put the `#` at the beginning of a line,
267267
followed by any number of spaces.
268268

269-
1. The length of constant string literals should be calculated via ``strlen()``
269+
5. The length of constant string literals should be calculated via ``strlen()``
270270
instead of using ``sizeof()-1`` as it is clearer and any modern compiler
271271
will optimize it away. Legacy usages of the latter style exists within the
272272
codebase but should not be refactored, unless larger refactoring around that

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ accompanied by [pull requests](#pull-requests). You can find the extremely large
7575
list of RFCs that have been previously considered on the
7676
[PHP Uncyclo](https://wiki.php.net/rfc).
7777

78-
To create a RFC, discuss it with the extension maintainer, and discuss it on the
79-
development mailing list [email protected]. RFC Uncyclo accounts can be
78+
To create an RFC, discuss it with the extension maintainer, and discuss it on
79+
the development mailing list [email protected]. RFC Uncyclo accounts can be
8080
requested on https://wiki.php.net/start?do=register. PHP extension maintainers
8181
can be found in the [EXTENSIONS](/EXTENSIONS) file in the PHP source code
8282
repository. Mailing list subscription is explained on the
@@ -318,7 +318,7 @@ detailed [information on Git](https://git-scm.com/).
318318

319319
PHP is developed through the efforts of a large number of people. Collaboration
320320
is a Good Thing(tm), and Git lets us do this. Thus, following some basic rules
321-
with regards to Git usage will:
321+
with regard to Git usage will:
322322

323323
* Make everybody happier, especially those responsible for maintaining PHP
324324
itself.
@@ -348,7 +348,7 @@ Having said that, here are the organizational rules:
348348
`--enable-zts` switch to ensure your code handles TSRM correctly and doesn't
349349
break for those who need that.
350350

351-
Currently we have the following branches in use:
351+
Currently, we have the following branches in use:
352352

353353
| Branch | |
354354
| --------- | --------- |

UPGRADING

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ PHP 8.3 UPGRADE NOTES
252252
now returns true on success, previously null was returned.
253253
. IntlBreakiterator::setText() now returns false on failure, previously
254254
null was returned.
255-
now returns true on sucess, previously null was returned.
255+
now returns true on success, previously null was returned.
256256
. IntlChar::enumCharNames is now returning a boolean.
257257
Previously it returned null on success and false on failure.
258258

@@ -443,7 +443,7 @@ PHP 8.3 UPGRADE NOTES
443443
A warning is emitted when trying to decrement values of type null, as
444444
this will change in the next major version.
445445
Internal objects that implement an _IS_NUMBER cast but not a do_operator
446-
handler that overrides addition and substraction now can be incremented
446+
handler that overrides addition and subtraction now can be incremented
447447
and decrement as if one would do $o += 1 or $o -= 1
448448

449449
- DOM:

0 commit comments

Comments
 (0)