TRUE, 'needs_environment' => TRUE, 'is_variadic' => TRUE, ] ), ]; } return []; } /** * Dumps information about variables using Symfony VarDumper. * * @param \Twig\Environment $env * The Twig environment. * @param array $context * Variables from the Twig template. * @param array $variables * (optional) Variable(s) to dump. */ public static function dump(Environment $env, array $context, ...$variables): void { if (!$env->isDebug()) { return; } if (class_exists(self::SYMFONY_VAR_DUMPER_CLASS)) { if (func_num_args() === 2) { call_user_func(self::SYMFONY_VAR_DUMPER_CLASS . '::dump', $context); } else { array_walk($variables, self::SYMFONY_VAR_DUMPER_CLASS . '::dump'); } } else { throw new \LogicException('Could not dump the variable because symfony/var-dumper component is not installed.'); } } }