InputBag.php in Drupal 9
File
core/lib/Drupal/Core/Http/InputBag.php
View source
<?php
namespace Drupal\Core\Http;
use Symfony\Component\HttpFoundation\ParameterBag;
final class InputBag extends ParameterBag {
public function all(string $key = NULL) : array {
if ($key === NULL) {
return $this->parameters;
}
$value = $this->parameters[$key] ?? [];
if (!is_array($value)) {
throw new \UnexpectedValueException(sprintf('Unexpected value for parameter "%s": expecting "array", got "%s".', $key, get_debug_type($value)));
}
return $value;
}
}
Classes
Name |
Description |
InputBag |
Forward compatibility class for Symfony 5. |