In Drupal 6, I could control block visibility using PHP code in the block UI configuration like:
<?php return MYMODULE_abc() || MYMODULE_def() ; ?>
These functions looked up the current node, taxonomy, etc. to decide on whether to display the block. This PHP option is gone in Drupal 8, but there is a
$visibility field in
BlockBase. Can I use this to programmatically set the visibility at runtime?