// If the content is empty and no placeholder is available, return.
if ($is_content_empty && !
$is_placeholder_ready) { return;
} $build =
[ // @todo Move this to BlockBase in https://www.drupal.org/node/2931040.
'#theme' => 'block',
'#configuration' =>
$block->
getConfiguration(),
'#plugin_id' =>
$block->
getPluginId(),
'#base_plugin_id' =>
$block->
getBaseId(),
'#derivative_plugin_id' =>
$block->
getDerivativeId(),
'#in_preview' =>
$event->
inPreview(),
'#weight' =>
$event->
getComponent()->
getWeight(),
];
// Place the $content returned by the block plugin into a 'content' child
// element, as a way to allow the plugin to have complete control of its
// properties and rendering (for instance, its own #theme) without
// conflicting with the properties used above, or alternate ones used by
// alternate block rendering approaches in contributed modules. However,
// the use of a child element is an implementation detail of this
// particular block rendering approach. Semantically, the content returned