Skip to content

Commit 1b9b88e

Browse files
committed
Combine sections now that the SHOULD/MUST is repeated.
1 parent 99888eb commit 1b9b88e

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/Pure.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232
*
3333
* 1. MUST NOT use or modify any global variable.
3434
* 2. MIST NOT perform any IO operations, even read-only ones.
35-
* 3. MUST NOT modify any property of an object provided to it as an
35+
* 3. MUST NOT modify any property of an object provided to it as an
3636
* argument, even transitively.
37-
* 4. MUST NOT read from an object property on the same object unless
37+
* 4. MUST NOT read from an object property on the same object unless
3838
* that property is `readonly`.
3939
* 5. MUST NOT accept a parameter by reference.
40-
* 6. MUST NOT call any function that is not also marked "pure." (It
40+
* 6. MUST NOT call any function that is not also marked "pure." (It
4141
* may invoke a callable passed to it as an explicit argument.)
4242
*
4343
* ## When should the attribute be applied
@@ -49,21 +49,19 @@
4949
* implementations of that method MUST themselves be marked pure.
5050
*
5151
* Static analysis tools
52-
* - SHOULD verify that the function indeed meets the rules above,
52+
* - SHOULD verify that the function indeed meets the rules above,
5353
* and treat it as an error if not.
54-
*
55-
* Static analysis tools
56-
* - MUST treat PHP standard library functions that conform to these
54+
* - MUST treat PHP standard library functions that conform to these
5755
* rules as pure. As an example, `strtolower()` is pure. `sort()`
5856
* is not.
59-
* - MUST flag as an error any function that is marked pure but is
57+
* - MUST flag as an error any function that is marked pure but is
6058
* demonstrably not.
6159
* - MUST treat any method implementing an interface method marked
6260
* pure as pure.
6361
*
6462
* Optimization tools and pre-compilation tools:
65-
* - MAY implement optimizations based on the knowledge that a function
66-
* is pure. For example, they may safely cache its results indefinitely,
63+
* - MAY implement optimizations based on the knowledge that a function
64+
* is pure. For example, they may safely cache its results indefinitely,
6765
* or inline its code into another routine.
6866
*
6967
*/

0 commit comments

Comments
 (0)