original_string: protected function parseTemplate(IncidentTemplate $template, UpdateIncidentCommand $command)
      {
          $env = new Twig_Environment(new Twig_Loader_Array([]));
          $template = $env->createTemplate($template->template);
  
          $vars = array_merge($command->template_vars, [
              'incident' => [
                  'name'             => $command->name,
                  'status'           => $command->status,
                  'message'          => $command->message,
                  'visible'          => $command->visible,
                  'notify'           => $command->notify,
                  'stickied'         => $command->stickied,
                  'occurred_at'      => $command->occurred_at,
                  'component'        => Component::find($command->component_id) ?: null,
                  'component_status' => $command->component_status,
              ],
          ]);
  
          return $template->render($vars);
      }
code: protected function parseTemplate(IncidentTemplate $template, UpdateIncidentCommand $command)
      {
          $env = new Twig_Environment(new Twig_Loader_Array([]));
          $template = $env->createTemplate($template->template);
  
          $vars = array_merge($command->template_vars, [
              'incident' => [
                  'name'             => $command->name,
                  'status'           => $command->status,
                  'message'          => $command->message,
                  'visible'          => $command->visible,
                  'notify'           => $command->notify,
                  'stickied'         => $command->stickied,
                  'occurred_at'      => $command->occurred_at,
                  'component'        => Component::find($command->component_id) ?: null,
                  'component_status' => $command->component_status,
              ],
          ]);
  
          return $template->render($vars);
      }
code_tokens: protected function parseTemplate ( IncidentTemplate $ template , UpdateIncidentCommand $ command ) { $ env = new Twig_Environment ( new Twig_Loader_Array ( [ ] ) ) ; $ template = $ env -> createTemplate ( $ template -> template ) ; $ vars = array_merge ( $ command -> template_vars , [ 'incident' => [ 'name' => $ command -> name , 'status' => $ command -> status , 'message' => $ command -> message , 'visible' => $ command -> visible , 'notify' => $ command -> notify , 'stickied' => $ command -> stickied , 'occurred_at' => $ command -> occurred_at , 'component' => Component :: find ( $ command -> component_id ) ? : null , 'component_status' => $ command -> component_status , ] , ] ) ; return $ template -> render ( $ vars ) ; }
docstring: Compiles an incident template into an incident message.
  
  @param \CachetHQ\Cachet\Models\IncidentTemplate                     $template
  @param \CachetHQ\Cachet\Bus\Commands\Incident\UpdateIncidentCommand $command
  
  @return string
docstring_tokens: Compiles an incident template into an incident message .