Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ParameterBag.php

function ParameterBag::all

Same name in this branch
  1. 11.1.x vendor/symfony/dependency-injection/ParameterBag/ParameterBag.php \Symfony\Component\DependencyInjection\ParameterBag\ParameterBag::all()

Returns the parameters.

Parameters

string|null $key The name of the parameter to return or null to get them all:

2 calls to ParameterBag::all()
MediaLibraryState::getAllowedTypeIds in core/modules/media_library/src/MediaLibraryState.php
Returns the media type IDs which can be selected.
MediaLibraryState::getOpenerParameters in core/modules/media_library/src/MediaLibraryState.php
Returns all opener-specific parameter values.

File

vendor/symfony/http-foundation/ParameterBag.php, line 36

Class

ParameterBag
ParameterBag is a container for key/value pairs.

Namespace

Symfony\Component\HttpFoundation

Code

public function all(?string $key = null) : array {
    if (null === $key) {
        return $this->parameters;
    }
    if (!\is_array($value = $this->parameters[$key] ?? [])) {
        throw new BadRequestException(\sprintf('Unexpected value for parameter "%s": expecting "array", got "%s".', $key, get_debug_type($value)));
    }
    return $value;
}
RSS feed
Powered by Drupal