Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Directory.php

function Directory::render

File

vendor/phpunit/php-code-coverage/src/Report/Html/Renderer/Directory.php, line 26

Class

Directory
@internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage

Namespace

SebastianBergmann\CodeCoverage\Report\Html

Code

public function render(DirectoryNode $node, string $file) : void {
    $templateName = $this->templatePath . ($this->hasBranchCoverage ? 'directory_branch.html' : 'directory.html');
    $template = new Template($templateName, '{{', '}}');
    $this->setCommonTemplateVariables($template, $node);
    $items = $this->renderItem($node, true);
    foreach ($node->directories() as $item) {
        $items .= $this->renderItem($item);
    }
    foreach ($node->files() as $item) {
        $items .= $this->renderItem($item);
    }
    $template->setVar([
        'id' => $node->id(),
        'items' => $items,
    ]);
    try {
        $template->renderTo($file);
    } catch (Exception $e) {
        throw new FileCouldNotBeWrittenException($e->getMessage(), $e->getCode(), $e);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal