class ParamConversionEnhancer implements EnhancerInterface, EventSubscriberInterface (View source)

Provides a route enhancer that handles parameter conversion.

Properties

protected ParamConverterManagerInterface $paramConverterManager

The parameter conversion manager.

Methods

__construct(ParamConverterManagerInterface $param_converter_manager)

Constructs a new ParamConversionEnhancer.

enhance(array $defaults, Request $request)

{@inheritdoc}

ParameterBag
copyRawVariables(array $defaults)

Store a backup of the raw values that corresponding to the route pattern.

onException(GetResponseForExceptionEvent $event)

Catches failed parameter conversions and throw a 404 instead.

static 
getSubscribedEvents()

{@inheritdoc}

Details

__construct(ParamConverterManagerInterface $param_converter_manager)

Constructs a new ParamConversionEnhancer.

Parameters

ParamConverterManagerInterface $param_converter_manager

The parameter conversion manager.

enhance(array $defaults, Request $request)

{@inheritdoc}

Parameters

array $defaults
Request $request

protected ParameterBag copyRawVariables(array $defaults)

Store a backup of the raw values that corresponding to the route pattern.

Parameters

array $defaults

The route defaults array.

Return Value

ParameterBag

onException(GetResponseForExceptionEvent $event)

Catches failed parameter conversions and throw a 404 instead.

Parameters

GetResponseForExceptionEvent $event

static getSubscribedEvents()

{@inheritdoc}