use entityQuery within a Block plugin I'm attempting to use queries within a block plugin to avoid using views for performance purposes.

namespace Drupal\my_plugins\Plugin\Block;

use Drupal\Core\Block\BlockBase;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Entity\Query;

/**
 * @Block(
 *   id = "basic_text",
 *   admin_label = @Translation("Basic Block")
 * )
 */

class Basic extends BlockBase {

    /**
     * {@inheritdoc}
     */
    public function defaultConfiguration() {
        return array(
            'bodytext-submit' =&gt; $this-&gt;t('Enter text here'), 
            'layout' =&gt; array('pane-type-submit' =&gt; 'box'),
            );
    }

    /**
     * {@inheritdoc}
     */
    public function blockForm($form, FormStateInterface $form_state){
        include 'StyleForm.php';

        $form['bodytext'] = array(
          '#type' =&gt; 'text_format',
          '#title' =&gt; $this-&gt;t('Block contents'),
          '#format' =&gt; 'full_html',
          '#description' =&gt; $this-&gt;t('This text will appear in the block.'),
          '#default_value' =&gt; $this-&gt;configuration['bodytext-submit'],
        );
        return $form;
    }

    public function blockSubmit($form, FormStateInterface $form_state) {
        $this-&gt;configuration['bodytext-submit']  = $form_state-&gt;getValue('bodytext');
        }

    public function build(){
        $query = \Drupal::entityQuery('node');
        $nids = $query-&gt;execute();
        return array(
            '#type' =&gt; 'markup',
            '#markup' =&gt; $this-&gt;configuration['bodytext-submit']['value'],
        );
    }
}


I ultimately want to be able to perform a query and display a list of nodes that fulfill a certain requirement. As a test I performed an empty query for all nodes without displaying any of the results. But when I add            

$query = \Drupal::entityQuery('node');
$nids = $query-&gt;execute();


to the build() function. It makes it so I can't render the block. I would like to be able to perform entity queries and display the results within the block.
There are brackets missing:

$nids = $query-&gt;execute();


In my block this works:

 public function build() {
   $query = \Drupal::entityQuery('node');
   $nids = $query-&gt;execute();

  $build = [
   '#theme' =&gt; 'item_list',
   '#items' =&gt; $nids,
  ];

 return $build;
}