Skip to content

Commit 0d3aac0

Browse files
committed
[TASK] Add note about type narrowing
1 parent e1d693d commit 0d3aac0

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Documentation/HandlingAPatch/Tips.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,14 @@ General checks
290290
("cognitive complexity") that could be easier to read when using different conditions/loops/sub-methods?
291291
* Do breaking changes occur that need to be noticed? This can also apply to:
292292

293-
* **Type hinting / type declarations**
293+
* **Type hinting / type declarations** - specifically, narrowing type
294+
declarations should usually not be backported to patchlevel
295+
versions (especially if it affects public methods/properties). Similarly,
296+
adding type-casting to variables declared as "pass by reference" in their
297+
method signatures should be prevented in backports.
294298
* using PHP features beyond the supported PHP version
295299
* Loss of existing functionality
296-
* Typos
300+
* Typos (specifically in variable/method/function/property names)
297301

298302
* Are new class, method, function, **variable names understandable**
299303
* Are possibilities for **early code returns** and reduced **nesting levels** addressed?

0 commit comments

Comments
 (0)