Skip to content

Assertion::inArray w/ constant array support #15

@b1rdex

Description

@b1rdex

Should specify type to a union of the array values.

$format = $_GET['foo'];

Assertion::inArray($format, [ // or Assertion::choice
    ExportFormat::FORMAT_CSV,
    ExportFormat::FORMAT_EXCEL,
]);

\PhpStan\dumpType($format); // ExportFormat::FORMAT_CSV|ExportFormat::FORMAT_EXCEL

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions