Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

InputBag::get() should be smarter #177

Copy link
Copy link
Closed
@vhenzl

Description

@vhenzl
Issue body actions

While technically correct, the change in 716a70d leads to false positive reports for code like this:

$abc = $request->query->get('abc');
Assert::notNull($abc);
expectString($abc); // 💥 Parameter #1 $str of function expectString expects string, bool|float|int|string given.

AFAIK Symfony never converts query string values from string to other types. So unless the $defaultValue argument is specified, InputBag::get() always returns string|null. And if $defaultValue is specified, the return type should be string|T where T extends string|int|float|bool|null.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.