Problem/Motivation
Before we can add declare(strict_types=1)
to existing code we need to fix strict type errors. We can detect some of these with phpstan, via the FunctionCallParametersCheck rule.
Steps to reproduce
To activate the FunctionCallParametersCheck
rule we can add the following parameter to phpstan.neon.dist:
parameters:
checkFunctionArgumentTypes: true
Proposed resolution
Review detected errors and fix them in child issues.
Remaining tasks
- #3459170: Fix instances of ints passed to functions expecting strings
- #3461945: Fix instances of floats passed to functions expecting ints
- #3463440: Fix array param docs identified by phpstan
- Decide what to do after calling $storage->loadMultiple and passing the EntityInterface to functions expecting something more specific
- ...
- Enable
checkFunctionArgumentTypes
parameter in phpstan.neon.dist