/** * {@inheritdoc} */ public function apply(Request $request, ParamConverter $configuration) { $name = $configuration->getName(); $country = $this->zonesService->getCountryByIsoCode2Letters($request->get('country')); $inflector = Inflector::get(strtolower($country->getIsoCode2Letters())); $zoneTypeSlug = $inflector->singularize($request->get($name)); $zoneType = $this->zonesService->getZoneTypeFromSlug($zoneTypeSlug, $country); $request->attributes->set('zoneType', $zoneType); return true; }