Skip to content

Statically Analysable HeaderBag Get Methods #31317

@rickogden

Description

@rickogden

Description
Currently the HeaderBag::get() method can return a string or array depending on the flag passed in the last argument. This causes static analysis issues as it can't be accurately determined what data type can be returned. I suggest this could be replaced with separate methods which declare/document the return type.

Example
Method to return the first as a string: public function getFirst($key, $default = null): string
Method to return the array public function getAll($key, $default = null): array

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions