// @see \Drupal\Core\Render\RenderCacheInterface::get()
// @see \Drupal\Core\Render\RenderCacheInterface::set()
$pre_bubbling_elements =
array_intersect_key($elements,
[ '#cache' => TRUE,
'#lazy_builder' => TRUE,
'#create_placeholder' => TRUE,
]);
// If the default values for this element have not been loaded yet, populate
// them.
if (isset($elements['#type'
]) &&
empty($elements['#defaults_loaded'
])) { $elements +=
$this->elementInfo->
getInfo($elements['#type'
]);
} // First validate the usage of #lazy_builder; both of the next if-statements
// use it if available.
if (isset($elements['#lazy_builder'
])) { assert(is_array($elements['#lazy_builder'
]), 'The #lazy_builder property must have an array as a value.'
);
assert(count($elements['#lazy_builder'
]) === 2, 'The #lazy_builder property must have an array as a value, containing two values: the callback, and the arguments for the callback.'
);
assert(is_array($elements['#lazy_builder'
][1
]), 'The #lazy_builder argument for callback must have an array as a value.'
);
assert(count($elements['#lazy_builder'
][1
]) ===
count(array_filter($elements['#lazy_builder'
][1
],
function D
$v) { return is_null($v) ||
is_scalar($v);
})), "A #lazy_builder callback's context may only contain scalar values or NULL."
);