3 namespace Drupal\webprofiler\Routing;
5 use Drupal\Core\ParamConverter\ParamConverterInterface;
6 use Symfony\Component\Routing\Route;
11 class TokenConverter implements ParamConverterInterface {
16 public function convert($value, $definition, $name, array $defaults) {
17 // "profiler" service isn't injected to prevent circular reference when
18 // more than one language is active and "Account administration pages" is
19 // enabled on admin/config/regional/language/detection. See #2710787 for
21 /** @var \Drupal\webprofiler\Profiler\Profiler $profiler */
22 $profiler = \Drupal::service('profiler');
24 if (NULL === $profiler) {
28 $profile = $profiler->loadProfile($value);
30 if (NULL === $profile) {
40 public function applies($definition, $name, Route $route) {
41 if (!empty($definition['type']) && $definition['type'] === 'webprofiler:token') {