functional-php/phpstan.neon
Kacper Donat f3f05fd00c add native fast paths for eager transforms
Arrays and php-ds collections are transformed directly instead of through the lazy generators. merge() into an array now rejects keys that can't be array keys with a clear error, like toArray().
2026-10-27 23:08:34 +01:00

29 lines
1.3 KiB
Plaintext

parameters:
level: 8
# The library's floor. The type tests use the 8.5 pipe operator, so they have their own config:
# phpstan.types.neon. `composer phpstan` runs both.
phpVersion: 80200
paths:
- src
ignoreErrors:
-
# Eager transforms are typed with a conditional closure type that maps the input container to the result
# container (see keyedLike()/listLike(), which implement it). PHPStan can't check a closure literal
# against such a type, so only that mismatch is ignored.
identifier: return.type
message: '#^Function Kadet\\Functional\\Collections\\\w+\(\) should return Closure<TIn of iterable>\(TIn\): \(TIn is array \?#'
path: src/Collections/transforms.php
-
# toArray() and merge() into an array keep PHP's own coercion of bool, float and null keys, as an array
# literal would.
identifier: offsetAccess.invalidOffset
message: '#^Possibly invalid array key type \(?bool#'
paths:
- src/Collections/collectors.php
- src/Collections/transforms.php
includes:
# Errors in the code that predates PHPStan in this project (untyped pre-1.0 functions and classes). New code
# must pass without entries here.
- phpstan-baseline.neon