function TestCallables::lazyBuilder

File

core/tests/Drupal/Tests/Core/Render/RendererTest.php, line 1233

Class

TestCallables
Mock callable for testing the pre_render callback.

Namespace

Drupal\Tests\Core\Render

Code

public static function lazyBuilder(bool $set_type) : array {
  $build['content'] = [
    '#markup' => 'Content',
  ];
  if ($set_type) {
    $build['#type'] = 'details';
  }
  return $build;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.