You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Add missing return types. In closures touched anyway, also add
parameter types.
- Avoid capturing unused variables. They are used in the commented-out
part; to make the commented-out part work out of the box if
uncommented, use arrow functions (available since PHP 7.4) instead of
traditional anonymous functions: arrow functions capture variables
automatically, so the `use` block can simply be skipped. Use arrow
functions for other touched closures as well.
- Add return types to `JsonSerializable::jsonSerialize()` overrides. The
lack of return types cause deprecation warnings on PHP 8. The
recommended return type of `mixed` cannot be used on PHP 7.4 (which we
still support according to `composer.json`), but fortunately all
classes consistently return arrays, so `array` could be added as a
return type instead (which is available in PHP 7.4 as well, and which
is stricter than the type stated by the interface – covariant return
types are allowed since PHP 7.4).
- Fix a wrongly documented type: the nicknames are objects, not strings.
Refactor the code a bit to make it easier to tell this PHPStan.
I skipped one error that looks real and that I don’t know how to fix:
the documentation states that `App\Model\Overpass\Element::$tags` is
nullable but it’s used as if it wasn’t; I don’t know Overpass, so I have
no idea which one is right.
0 commit comments