class Context
Same name in this branch
- 11.1.x vendor/open-telemetry/api/Instrumentation/AutoInstrumentation/Context.php \OpenTelemetry\API\Instrumentation\AutoInstrumentation\Context
- 11.1.x vendor/open-telemetry/context/Context.php \OpenTelemetry\Context\Context
- 11.1.x vendor/sebastian/recursion-context/src/Context.php \SebastianBergmann\RecursionContext\Context
- 11.1.x vendor/phpdocumentor/type-resolver/src/Types/Context.php \phpDocumentor\Reflection\Types\Context
- 11.1.x core/lib/Drupal/Core/Plugin/Context/Context.php \Drupal\Core\Plugin\Context\Context
- 11.1.x core/lib/Drupal/Component/Plugin/Context/Context.php \Drupal\Component\Plugin\Context\Context
@author Maxime Steinhausser <maxime.steinhausser@gmail.com>
Hierarchy
- class \Symfony\Component\Serializer\Attribute\Context
Expanded class hierarchy of Context
1 file declares its use of Context
- AttributeLoader.php in vendor/
symfony/ serializer/ Mapping/ Loader/ AttributeLoader.php
18 string references to 'Context'
- CompiledUrlMatcherDumper::compileRoute in vendor/
symfony/ routing/ Matcher/ Dumper/ CompiledUrlMatcherDumper.php - Compiles a single Route to PHP code used to match it against the path info.
- ConditionManagerCreateInstanceContextConfigurationRule::processNode in vendor/
mglaman/ phpstan-drupal/ src/ Rules/ Deprecations/ ConditionManagerCreateInstanceContextConfigurationRule.php - LocaleConfigManager::processTranslatableData in core/
modules/ locale/ src/ LocaleConfigManager.php - Process the translatable data array with a given language.
- LocaleConfigSubscriber::processTranslatableData in core/
modules/ locale/ src/ LocaleConfigSubscriber.php - Process the translatable data array with a given language.
- LocaleConfigSubscriber::resetExistingTranslations in core/
modules/ locale/ src/ LocaleConfigSubscriber.php - Reset existing locale translations to their source values.
File
-
vendor/
symfony/ serializer/ Attribute/ Context.php, line 19
Namespace
Symfony\Component\Serializer\AttributeView source
class Context {
private array $groups;
/**
* @param array<string, mixed> $context The common context to use when serializing or deserializing
* @param array<string, mixed> $normalizationContext The context to use when serializing
* @param array<string, mixed> $denormalizationContext The context to use when deserializing
* @param string|string[] $groups The groups to use when serializing or deserializing
*
* @throws InvalidArgumentException
*/
public function __construct(array $context = [], array $normalizationContext = [], array $denormalizationContext = [], string|array $groups = []) {
if (!$context && !$normalizationContext && !$denormalizationContext) {
throw new InvalidArgumentException(\sprintf('At least one of the "context", "normalizationContext", or "denormalizationContext" options must be provided as a non-empty array to "%s".', static::class));
}
$this->groups = (array) $groups;
foreach ($this->groups as $group) {
if (!\is_string($group)) {
throw new InvalidArgumentException(\sprintf('Parameter "groups" given to "%s" must be a string or an array of strings, "%s" given.', static::class, get_debug_type($group)));
}
}
}
public function getContext() : array {
return $this->context;
}
public function getNormalizationContext() : array {
return $this->normalizationContext;
}
public function getDenormalizationContext() : array {
return $this->denormalizationContext;
}
public function getGroups() : array {
return $this->groups;
}
}
Members
Title Sort descending | Modifiers | Object type | Summary |
---|---|---|---|
Context::$groups | private | property | |
Context::getContext | public | function | |
Context::getDenormalizationContext | public | function | |
Context::getGroups | public | function | |
Context::getNormalizationContext | public | function | |
Context::__construct | public | function |