Skip to content

Commit f6d55c6

Browse files
committed
Updated README
1 parent 4bd45d6 commit f6d55c6

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77
[PHPStan](https://github.com/phpstan/phpstan) focuses on finding bugs in your code. But in PHP there's a lot of leeway in how stuff can be written. This repository contains additional rules that revolve around strictly and strongly typed code with no loose casting for those who want additional safety in extremely defensive programming:
88

99
* Require booleans in `if`, `elseif`, ternary operator, after `!`, and on both sides of `&&` and `||`.
10-
* Functions `in_array` and `array_search` must be called with third parameter `$strict` set to `true` to search values with matching types only.
10+
* These functions contain a `$strict` parameter for better type safety, it must be set to `true`:
11+
* `in_array` (3rd parameter)
12+
* `array_search` (3rd parameter)
13+
* `array_keys` (3rd parameter; only if the 2nd parameter `$search_value` is provided)
14+
* `base64_decode` (2nd parameter)
1115
* Variables assigned in `while` loop condition and `for` loop initial assignment cannot be used after the loop.
1216
* Types in `switch` condition and `case` value must match. PHP compares them loosely by default and that can lead to unexpected results.
1317
* Statically declared methods are called statically.

0 commit comments

Comments
 (0)