Assertion::inArray w/ constant array support
b1rdex opened this issue · 0 comments
b1rdex commented
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