diff --git a/poll.install b/poll.install
index 20fa756..7ef6dd3 100644
--- a/poll.install
+++ b/poll.install
@@ -11,59 +11,59 @@
  * Implements hook_schema().
  */
 function poll_schema() {
-  $schema['poll_vote'] = array(
+  $schema['poll_vote'] = [
     'description' => 'Stores per-{users} votes for each {poll}.',
-    'fields' => array(
-      'chid' => array(
+    'fields' => [
+      'chid' => [
         'type' => 'int',
         'unsigned' => TRUE,
         'not null' => TRUE,
         'description' => "The {users}'s vote for this poll.",
-      ),
-      'pid' => array(
+      ],
+      'pid' => [
         'type' => 'int',
         'unsigned' => TRUE,
         'not null' => TRUE,
         'description' => 'The {poll} entity this vote is for.',
-      ),
-      'uid' => array(
+      ],
+      'uid' => [
         'type' => 'int',
         'unsigned' => TRUE,
         'not null' => TRUE,
         'default' => 0,
         'description' => 'The {users}.uid this vote is from unless the voter was anonymous.',
-      ),
-      'hostname' => array(
+      ],
+      'hostname' => [
         'type' => 'varchar',
         'length' => 128,
         'not null' => TRUE,
         'default' => '',
         'description' => 'The IP address this vote is from unless the voter was logged in.',
-      ),
-      'timestamp' => array(
+      ],
+      'timestamp' => [
         'type' => 'int',
         'not null' => TRUE,
         'default' => 0,
         'description' => 'The timestamp of the vote creation.',
-      ),
-    ),
-    'primary key' => array('pid', 'uid', 'hostname'),
-    'foreign keys' => array(
-      'poll_entity' => array(
+      ],
+    ],
+    'primary key' => ['pid', 'uid', 'hostname'],
+    'foreign keys' => [
+      'poll_entity' => [
         'table' => 'poll',
-        'columns' => array('pid' => 'pid'),
-      ),
-      'voter' => array(
+        'columns' => ['pid' => 'pid'],
+      ],
+      'voter' => [
         'table' => 'users',
-        'columns' => array('uid' => 'uid'),
-      ),
-    ),
-    'indexes' => array(
-      'chid' => array('chid'),
-      'hostname' => array('hostname'),
-      'uid' => array('uid'),
-    ),
-  );
+        'columns' => ['uid' => 'uid'],
+      ],
+    ],
+    'indexes' => [
+      'chid' => ['chid'],
+      'hostname' => ['hostname'],
+      'uid' => ['uid'],
+    ],
+  ];
 
   return $schema;
 }
diff --git a/poll.module b/poll.module
index ed12dcd..758dda0 100644
--- a/poll.module
+++ b/poll.module
@@ -26,13 +26,13 @@ function poll_help($route_name, RouteMatchInterface $route_match) {
   switch ($route_name) {
     case 'help.page.poll':
       $output = '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Poll module can be used to create simple surveys or questionnaires that display cumulative results. A poll is a good way to receive feedback from site users and community members. For more information, see the online handbook entry for the <a href=":poll">Poll module</a>.', array(':poll' => 'https://www.drupal.org/docs/8/modules/poll')) . '</p>';
+      $output .= '<p>' . t('The Poll module can be used to create simple surveys or questionnaires that display cumulative results. A poll is a good way to receive feedback from site users and community members. For more information, see the online handbook entry for the <a href=":poll">Poll module</a>.', [':poll' => 'https://www.drupal.org/docs/8/modules/poll']) . '</p>';
       $output .= '<h3>' . t('Uses') . '</h3>';
       $output .= '<dl>';
       $output .= '<dt>' . t('Creating a poll') . '</dt>';
-      $output .= '<dd>' . t('Users can create a poll by clicking on <a href=":add-poll">Add a poll</a> on the <a href=":polls">Polls</a> page, and entering the question being posed, the answer choices, and beginning vote counts for each choice. The status (closed or active) and duration (length of time the poll remains active for new votes) can also be specified.', array(':add-poll' => \Drupal::url('poll.poll_add'), ':polls' => \Drupal::url('poll.poll_list'))) . '</dd>';
+      $output .= '<dd>' . t('Users can create a poll by clicking on <a href=":add-poll">Add a poll</a> on the <a href=":polls">Polls</a> page, and entering the question being posed, the answer choices, and beginning vote counts for each choice. The status (closed or active) and duration (length of time the poll remains active for new votes) can also be specified.', [':add-poll' => \Drupal::url('poll.poll_add'), ':polls' => \Drupal::url('poll.poll_list')]) . '</dd>';
       $output .= '<dt>' . t('Viewing polls') . '</dt>';
-      $output .= '<dd>' . t('You can visit the <a href=":polls">Polls</a> page to view all current polls, or alternately enable the <em>Most recent poll</em> block on the <a href=":blocks">Blocks administration page</a>. To vote in or view the results of a specific poll, you can click on the poll itself.', array(':polls' => \Drupal::url('poll.poll_list'), ':blocks' => \Drupal::url('block.admin_display'))) . '</dd>';
+      $output .= '<dd>' . t('You can visit the <a href=":polls">Polls</a> page to view all current polls, or alternately enable the <em>Most recent poll</em> block on the <a href=":blocks">Blocks administration page</a>. To vote in or view the results of a specific poll, you can click on the poll itself.', [':polls' => \Drupal::url('poll.poll_list'), ':blocks' => \Drupal::url('block.admin_display')]) . '</dd>';
       $output .= '</dl>';
       return $output;
   }
@@ -42,17 +42,17 @@ function poll_help($route_name, RouteMatchInterface $route_match) {
  * Implements hook_theme().
  */
 function poll_theme() {
-  $theme_hooks = array(
-    'poll_vote' => array(
+  $theme_hooks = [
+    'poll_vote' => [
       'template' => 'poll-vote',
       'render element' => 'form',
-    ),
-    'poll_choices' => array(
+    ],
+    'poll_choices' => [
       'render element' => 'form',
-    ),
-    'poll_results' => array(
+    ],
+    'poll_results' => [
       'template' => 'poll-results',
-      'variables' => array(
+      'variables' => [
         'raw_question' => NULL,
         'results' => NULL,
         'votes' => NULL,
@@ -60,11 +60,11 @@ function poll_theme() {
         'pid' => NULL,
         'vote' => NULL,
         'show_question' => FALSE,
-      ),
-    ),
-    'poll_meter' => array(
+      ],
+    ],
+    'poll_meter' => [
       'template' => 'poll-meter',
-      'variables' => array(
+      'variables' => [
         'display_value' => NULL,
         'form' => NULL,
         'high' => NULL,
@@ -75,10 +75,10 @@ function poll_theme() {
         'choice' => NULL,
         'value' => NULL,
         'percentage' => NULL,
-        'attributes' => array()
-      ),
-    ),
-  );
+        'attributes' => []
+      ],
+    ],
+  ];
 
   return $theme_hooks;
 }
@@ -106,7 +106,7 @@ function poll_cron() {
  * Implements hook_entity_extra_field_info().
  */
 function poll_entity_extra_field_info() {
-  $extra = array();
+  $extra = [];
   $extra['poll']['poll']['display']['poll_votes'] = [
     'label' => t('Vote form/Results'),
     'description' => t('Vote form of the poll or the results depending on current user.'),
@@ -144,7 +144,7 @@ function template_preprocess_poll_vote(&$variables) {
 function template_preprocess_poll_meter(&$variables) {
 
   $attributes = $variables['attributes'];
-  foreach (array(
+  foreach ([
              'form',
              'high',
              'low',
@@ -153,7 +153,7 @@ function template_preprocess_poll_meter(&$variables) {
              'optimum',
              'choice',
              'value'
-           ) as $key) {
+           ] as $key) {
     if (isset($variables[$key])) {
       // This function was initially designed for the <meter> tag, but due to
       // the lack of browser and styling support for it, we're currently using
diff --git a/poll.tokens.inc b/poll.tokens.inc
index 95f6dc4..aac7bd1 100644
--- a/poll.tokens.inc
+++ b/poll.tokens.inc
@@ -11,37 +11,37 @@
  * Implements hook_token_info().
  */
 function poll_token_info() {
-  $node['votes'] = array(
+  $node['votes'] = [
     'name' => t("Poll votes"),
     'description' => t("The number of votes that have been cast on a poll."),
-  );
-  $node['winner'] = array(
+  ];
+  $node['winner'] = [
     'name' => t("Poll winner"),
     'description' => t("The winning poll answer."),
-  );
-  $node['winner-votes'] = array(
+  ];
+  $node['winner-votes'] = [
     'name' => t("Poll winner votes"),
     'description' => t("The number of votes received by the winning poll answer."),
-  );
-  $node['winner-percent'] = array(
+  ];
+  $node['winner-percent'] = [
     'name' => t("Poll winner percent"),
     'description' => t("The percentage of votes received by the winning poll answer."),
-  );
-  $node['duration'] = array(
+  ];
+  $node['duration'] = [
     'name' => t("Poll duration"),
     'description' => t("The length of time the poll is set to run."),
-  );
+  ];
 
-  return array(
-    'tokens' => array('poll' => $node),
-  );
+  return [
+    'tokens' => ['poll' => $node],
+  ];
 }
 
 /**
  * Implements hook_tokens().
  */
 function poll_tokens($type, $tokens, array $data, array $options, BubbleableMetadata $bubbleable_metadata) {
-  $replacements = array();
+  $replacements = [];
 
   if ($type == 'poll' && !empty($data['poll'])) {
     /** @var \Drupal\poll\Entity\Poll $poll */
diff --git a/src/Entity/Poll.php b/src/Entity/Poll.php
index 1584a36..5879eb5 100644
--- a/src/Entity/Poll.php
+++ b/src/Entity/Poll.php
@@ -208,16 +208,16 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
       ->setSetting('target_type', 'user')
       ->setTranslatable(TRUE)
       ->setDefaultValueCallback('Drupal\poll\Entity\Poll::getCurrentUserId')
-      ->setDisplayOptions('form', array(
+      ->setDisplayOptions('form', [
         'type' => 'entity_reference_autocomplete',
         'weight' => -10,
-        'settings' => array(
+        'settings' => [
           'match_operator' => 'CONTAINS',
           'size' => '60',
           'autocomplete_type' => 'tags',
           'placeholder' => '',
-        ),
-      ))
+        ],
+      ])
       ->setDisplayConfigurable('form', TRUE);
 
     $fields['uuid'] = BaseFieldDefinition::create('uuid')
@@ -231,10 +231,10 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
       ->setRequired(TRUE)
       ->setTranslatable(TRUE)
       ->setSetting('max_length', 255)
-      ->setDisplayOptions('form', array(
+      ->setDisplayOptions('form', [
         'type' => 'string_textfield',
         'weight' => -100,
-      ));
+      ]);
 
     $fields['langcode'] = BaseFieldDefinition::create('language')
       ->setLabel(t('Language code'))
@@ -257,7 +257,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
       ]);
 
     // Poll attributes
-    $duration = array(
+    $duration = [
       // 1-6 days.
       86400,
       2 * 86400,
@@ -277,7 +277,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
       9 * 2592000,
       // 1 year (365 days).
       31536000,
-    );
+    ];
 
     $period = array(0 => t('Unlimited')) + array_map(array(\Drupal::service('date.formatter'), 'formatInterval'), array_combine($duration, $duration));
 
@@ -288,58 +288,58 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
       ->setRequired(TRUE)
       ->setSetting('allowed_values', $period)
       ->setDefaultValue(0)
-      ->setDisplayOptions('form', array(
+      ->setDisplayOptions('form', [
         'type' => 'options_select',
         'weight' => 0,
-      ));
+      ]);
 
     $fields['anonymous_vote_allow'] = BaseFieldDefinition::create('boolean')
       ->setLabel(t('Allow anonymous votes'))
       ->setDescription(t('A flag indicating whether anonymous users are allowed to vote.'))
       ->setDefaultValue(0)
-      ->setDisplayOptions('form', array(
+      ->setDisplayOptions('form', [
         'type' => 'boolean_checkbox',
-        'settings' => array(
+        'settings' => [
           'display_label' => TRUE,
-        ),
+        ],
         'weight' => 1,
-      ));
+      ]);
 
     $fields['cancel_vote_allow'] = BaseFieldDefinition::create('boolean')
       ->setLabel(t('Allow cancel votes'))
       ->setDescription(t('A flag indicating whether users may cancel their vote.'))
       ->setDefaultValue(1)
-      ->setDisplayOptions('form', array(
+      ->setDisplayOptions('form', [
         'type' => 'boolean_checkbox',
-        'settings' => array(
+        'settings' => [
           'display_label' => TRUE,
-        ),
+        ],
         'weight' => 2,
-      ));
+      ]);
 
     $fields['result_vote_allow'] = BaseFieldDefinition::create('boolean')
       ->setLabel(t('Allow view results'))
       ->setDescription(t('A flag indicating whether users may see the results before voting.'))
       ->setDefaultValue(0)
-      ->setDisplayOptions('form', array(
+      ->setDisplayOptions('form', [
         'type' => 'boolean_checkbox',
-        'settings' => array(
+        'settings' => [
           'display_label' => TRUE,
-        ),
+        ],
         'weight' => 3,
-      ));
+      ]);
 
     $fields['status'] = BaseFieldDefinition::create('boolean')
       ->setLabel(t('Active'))
       ->setDescription(t('A flag indicating whether the poll is active.'))
       ->setDefaultValue(1)
-      ->setDisplayOptions('form', array(
+      ->setDisplayOptions('form', [
         'type' => 'boolean_checkbox',
-        'settings' => array(
+        'settings' => [
           'display_label' => TRUE,
-        ),
+        ],
         'weight' => -5,
-      ));
+      ]);
 
     $fields['created'] = BaseFieldDefinition::create('created')
       ->setLabel(t('Created'))
@@ -357,7 +357,7 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
    *   An array of default values.
    */
   public static function getCurrentUserId() {
-    return array(\Drupal::currentUser()->id());
+    return [\Drupal::currentUser()->id()];
   }
 
   /**
@@ -384,7 +384,7 @@ public function hasUserVoted() {
    * {@inheritdoc}
    */
   public function getOptions() {
-    $options = array();
+    $options = [];
     if (count($this->choice)) {
       foreach ($this->choice as $choice_item) {
         $options[$choice_item->target_id] = \Drupal::service('entity.repository')->getTranslationFromContext($choice_item->entity, $this->language()->getId())->label();
@@ -397,7 +397,7 @@ public function getOptions() {
    * {@inheritdoc}
    */
   public function getOptionValues() {
-    $options = array();
+    $options = [];
     if (count($this->choice)) {
       foreach ($this->choice as $choice_item) {
         $options[$choice_item->target_id] = 1;
diff --git a/src/Entity/PollChoice.php b/src/Entity/PollChoice.php
index 0eb17ac..913f320 100644
--- a/src/Entity/PollChoice.php
+++ b/src/Entity/PollChoice.php
@@ -78,10 +78,10 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
       ->setRequired(TRUE)
       ->setTranslatable(TRUE)
       ->setSetting('max_length', 255)
-      ->setDisplayOptions('form', array(
+      ->setDisplayOptions('form', [
         'type' => 'string_textfield',
         'weight' => -100,
-      ));
+      ]);
 
     $fields['langcode'] = BaseFieldDefinition::create('language')
       ->setLabel(t('Language code'))
diff --git a/src/Form/PollDeleteForm.php b/src/Form/PollDeleteForm.php
index 6fd77d8..007d775 100644
--- a/src/Form/PollDeleteForm.php
+++ b/src/Form/PollDeleteForm.php
@@ -22,7 +22,7 @@ public function getDescription() {
    * {@inheritdoc}
    */
   public function getQuestion() {
-    return $this->t('Are you sure you want to delete this poll %poll', array('%poll' => $this->entity->label()));
+    return $this->t('Are you sure you want to delete this poll %poll', ['%poll' => $this->entity->label()]);
   }
 
   /**
@@ -44,8 +44,8 @@ public function getConfirmText() {
    */
   public function submitForm(array &$form, FormStateInterface $form_state) {
     $this->entity->delete();
-    \Drupal::logger('poll')->notice('Poll %poll deleted.', array('%poll' => $this->entity->label()));
-    drupal_set_message($this->t('The poll %poll has been deleted.', array('%poll' => $this->entity->label())));
+    \Drupal::logger('poll')->notice('Poll %poll deleted.', ['%poll' => $this->entity->label()]);
+    drupal_set_message($this->t('The poll %poll has been deleted.', ['%poll' => $this->entity->label()]));
     $form_state->setRedirect('poll.poll_list');
   }
 
diff --git a/src/Form/PollForm.php b/src/Form/PollForm.php
index 0c92f87..28192cb 100644
--- a/src/Form/PollForm.php
+++ b/src/Form/PollForm.php
@@ -40,7 +40,7 @@ public function validateForm(array &$form, FormStateInterface $form_state) {
     $result = $poll_storage->getPollDuplicates($poll);
     foreach ($result as $item) {
       if (strcasecmp($item->label(), $poll->label()) == 0) {
-        $form_state->setErrorByName('question', $this->t('A feed named %feed already exists. Enter a unique question.', array('%feed' => $poll->label())));
+        $form_state->setErrorByName('question', $this->t('A feed named %feed already exists. Enter a unique question.', ['%feed' => $poll->label()]));
       }
     }
     parent::validateForm($form, $form_state);
@@ -54,11 +54,11 @@ public function save(array $form, FormStateInterface $form_state) {
     $insert = (bool) $poll->id();
     $poll->save();
     if ($insert) {
-      drupal_set_message($this->t('The poll %poll has been updated.', array('%poll' => $poll->label())));
+      drupal_set_message($this->t('The poll %poll has been updated.', ['%poll' => $poll->label()]));
     }
     else {
-      \Drupal::logger('poll')->notice('Poll %poll added.', array('%poll' => $poll->label(), 'link' => $poll->link($poll->label())));
-      drupal_set_message($this->t('The poll %poll has been added.', array('%poll' => $poll->label())));
+      \Drupal::logger('poll')->notice('Poll %poll added.', ['%poll' => $poll->label(), 'link' => $poll->link($poll->label())]);
+      drupal_set_message($this->t('The poll %poll has been added.', ['%poll' => $poll->label()]));
     }
 
     $form_state->setRedirect('poll.poll_list');
diff --git a/src/Form/PollItemsDeleteForm.php b/src/Form/PollItemsDeleteForm.php
index a32fdcf..0f796b7 100644
--- a/src/Form/PollItemsDeleteForm.php
+++ b/src/Form/PollItemsDeleteForm.php
@@ -15,7 +15,7 @@ class PollItemsDeleteForm extends ContentEntityConfirmFormBase {
    * {@inheritdoc}
    */
   public function getQuestion() {
-    return $this->t('Are you sure you want to delete all items from the feed %feed?', array('%feed' => $this->entity->label()));
+    return $this->t('Are you sure you want to delete all items from the feed %feed?', ['%feed' => $this->entity->label()]);
   }
 
   /**
diff --git a/src/Form/PollSettingsForm.php b/src/Form/PollSettingsForm.php
index 281384d..4a9fcf0 100644
--- a/src/Form/PollSettingsForm.php
+++ b/src/Form/PollSettingsForm.php
@@ -29,9 +29,9 @@ protected function getEditableConfigNames() {
    */
   public function buildForm(array $form, FormStateInterface $form_state) {
     // This exists to make the field UI pages visible and must not be removed.
-    $form['account'] = array(
+    $form['account'] = [
       '#markup' => '<p>' . t('There are no settings yet.') . '</p>',
-    );
+    ];
 
     return $form;
   }
diff --git a/src/Form/PollViewForm.php b/src/Form/PollViewForm.php
index f576194..173ef53 100644
--- a/src/Form/PollViewForm.php
+++ b/src/Form/PollViewForm.php
@@ -76,12 +76,12 @@ public function buildForm(array $form, FormStateInterface $form_state, Request $
     else {
       $options = $this->poll->getOptions();
       if ($options) {
-        $form['choice'] = array(
+        $form['choice'] = [
           '#type' => 'radios',
           '#title' => t('Choices'),
           '#title_display' => 'invisible',
           '#options' => $options,
-        );
+        ];
       }
       $form['#theme'] = 'poll_vote';
       $form['#entity'] = $this->poll;
@@ -100,9 +100,9 @@ public function buildForm(array $form, FormStateInterface $form_state, Request $
 
     $form['actions'] = $this->actions($form, $form_state, $this->poll);
 
-    $form['#cache'] = array(
+    $form['#cache'] = [
       'tags' => $this->poll->getCacheTags(),
-    );
+    ];
 
     return $form;
   }
@@ -175,7 +175,7 @@ protected function actions(array $form, FormStateInterface $form_state, $poll) {
         $actions['cancel']['#type'] = 'submit';
         $actions['cancel']['#button_type'] = 'primary';
         $actions['cancel']['#value'] = t('Cancel vote');
-        $actions['cancel']['#submit'] = array('::cancel');
+        $actions['cancel']['#submit'] = ['::cancel'];
         $actions['cancel']['#ajax'] = $ajax;
         $actions['cancel']['#weight'] = '0';
       }
@@ -184,7 +184,7 @@ protected function actions(array $form, FormStateInterface $form_state, $poll) {
         $actions['back']['#type'] = 'submit';
         $actions['back']['#button_type'] = 'primary';
         $actions['back']['#value'] = t('View poll');
-        $actions['back']['#submit'] = array('::back');
+        $actions['back']['#submit'] = ['::back'];
         $actions['back']['#ajax'] = $ajax;
         $actions['back']['#weight'] = '0';
       }
@@ -194,8 +194,8 @@ protected function actions(array $form, FormStateInterface $form_state, $poll) {
       $actions['vote']['#type'] = 'submit';
       $actions['vote']['#button_type'] = 'primary';
       $actions['vote']['#value'] = t('Vote');
-      $actions['vote']['#validate'] = array('::validateVote');
-      $actions['vote']['#submit'] = array('::save');
+      $actions['vote']['#validate'] = ['::validateVote'];
+      $actions['vote']['#submit'] = ['::save'];
       $actions['vote']['#ajax'] = $ajax;
       $actions['vote']['#weight'] = '0';
 
@@ -204,7 +204,7 @@ protected function actions(array $form, FormStateInterface $form_state, $poll) {
         $actions['result']['#type'] = 'submit';
         $actions['result']['#button_type'] = 'primary';
         $actions['result']['#value'] = t('View results');
-        $actions['result']['#submit'] = array('::result');
+        $actions['result']['#submit'] = ['::result'];
         $actions['result']['#ajax'] = $ajax;
         $actions['result']['#weight'] = '1';
       }
@@ -235,25 +235,25 @@ function showPollResults(PollInterface $poll, $block = FALSE) {
     }
 
     $options = $poll->getOptions();
-    $poll_results = array();
+    $poll_results = [];
     foreach ($poll->getVotes() as $pid => $vote) {
       $percentage = round($vote * 100 / max($total_votes, 1));
       $display_votes = (!$block) ? ' (' . \Drupal::translation()
           ->formatPlural($vote, '1 vote', '@count votes') . ')' : '';
 
-      $poll_results[] = array(
+      $poll_results[] = [
         '#theme' => 'poll_meter',
         '#choice' => $options[$pid],
-        '#display_value' => t('@percentage%', array('@percentage' => $percentage)) . $display_votes,
+        '#display_value' => t('@percentage%', ['@percentage' => $percentage]) . $display_votes,
         '#min' => 0,
         '#max' => $total_votes,
         '#value' => $vote,
         '#percentage' => $percentage,
-        '#attributes' => array('class' => array('bar')),
-      );
+        '#attributes' => ['class' => ['bar']],
+      ];
     }
 
-    $output = array(
+    $output = [
       '#theme' => 'poll_results',
       '#raw_question' => $poll->label(),
       '#results' => $poll_results,
@@ -261,7 +261,7 @@ function showPollResults(PollInterface $poll, $block = FALSE) {
       '#block' => $block,
       '#pid' => $poll->id(),
       '#vote' => isset($poll->vote) ? $poll->vote : NULL,
-    );
+    ];
 
     return $output;
   }
@@ -280,10 +280,10 @@ public function cancel(array $form, FormStateInterface $form_state) {
     /** @var \Drupal\poll\PollVoteStorageInterface $vote_storage */
     $vote_storage = \Drupal::service('poll_vote.storage');
     $vote_storage->cancelVote($this->poll, $this->currentUser());
-    \Drupal::logger('poll')->notice('%user\'s vote in Poll #%poll deleted.', array(
+    \Drupal::logger('poll')->notice('%user\'s vote in Poll #%poll deleted.', [
       '%user' => $this->currentUser()->id(),
       '%poll' => $this->poll->id(),
-    ));
+    ]);
     drupal_set_message($this->t('Your vote was cancelled.'));
 
     // In case of an ajax submission, trigger a form rebuild so that we can
@@ -322,7 +322,7 @@ public function back(array $form, FormStateInterface $form_state) {
    * @param \Drupal\Core\Form\FormStateInterface $form_state
    */
   public function save(array $form, FormStateInterface $form_state) {
-    $options = array();
+    $options = [];
     $options['chid'] = $form_state->getValue('choice');
     $options['uid'] = $this->currentUser()->id();
     $options['pid'] = $form_state->getValue('poll')->id();
diff --git a/src/Form/PollVoteDeleteForm.php b/src/Form/PollVoteDeleteForm.php
index 5eaa0a8..8eaa4e6 100644
--- a/src/Form/PollVoteDeleteForm.php
+++ b/src/Form/PollVoteDeleteForm.php
@@ -18,7 +18,7 @@ class PollVoteDeleteForm extends ContentEntityConfirmFormBase implements Contain
    * {@inheritdoc}
    */
   public function getQuestion() {
-    return $this->t('Are you sure you want to delete this vote for %poll', array('%poll' => $this->entity->label()));
+    return $this->t('Are you sure you want to delete this vote for %poll', ['%poll' => $this->entity->label()]);
   }
 
   /**
@@ -44,13 +44,13 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
     /** @var \Drupal\poll\PollVoteStorage $vote_storage */
     $vote_storage = \Drupal::service('poll_vote.storage');
     $vote_storage->cancelVote($this->entity, $account);
-    \Drupal::logger('poll')->notice('%user\'s vote in Poll #%poll deleted.', array(
+    \Drupal::logger('poll')->notice('%user\'s vote in Poll #%poll deleted.', [
       '%user' => $account->id(),
       '%poll' => $this->entity->id()
-    ));
+    ]);
     drupal_set_message($this->t('Your vote was cancelled.'));
 
     // Display the original poll.
-    $form_state->setRedirect('entity.poll.canonical', array('poll' => $this->entity->id()));
+    $form_state->setRedirect('entity.poll.canonical', ['poll' => $this->entity->id()]);
   }
 }
diff --git a/src/Plugin/Block/PollRecentBlock.php b/src/Plugin/Block/PollRecentBlock.php
index 80d2f6c..b5a6563 100644
--- a/src/Plugin/Block/PollRecentBlock.php
+++ b/src/Plugin/Block/PollRecentBlock.php
@@ -28,7 +28,7 @@ protected function blockAccess(AccountInterface $account) {
    * {@inheritdoc}
    */
   public function getCacheTags() {
-    return array('poll_list');
+    return ['poll_list'];
   }
 
   /**
diff --git a/src/Plugin/Field/FieldWidget/PollChoiceDefaultWidget.php b/src/Plugin/Field/FieldWidget/PollChoiceDefaultWidget.php
index eb6f10f..f329e4d 100644
--- a/src/Plugin/Field/FieldWidget/PollChoiceDefaultWidget.php
+++ b/src/Plugin/Field/FieldWidget/PollChoiceDefaultWidget.php
@@ -46,22 +46,22 @@ public function formElement(FieldItemListInterface $items, $delta, array $elemen
       $choice = $choice->getTranslation($langcode);
     }
 
-    $element['target_id'] = array(
+    $element['target_id'] = [
       '#type' => 'value',
       '#value' => $choice ? $choice->id() : NULL,
-    );
-    $element['langcode'] = array(
+    ];
+    $element['langcode'] = [
       '#type' => 'value',
       '#value' => $langcode,
-    );
+    ];
 
-    $element['choice'] = array(
+    $element['choice'] = [
       '#type' => 'textfield',
       '#placeholder' => t('Choice'),
       '#empty_value' => '',
       '#default_value' => $choice ? $choice->choice->value : NULL,
       '#prefix' => '<div class="container-inline">',
-    );
+    ];
     return $element;
   }
 
diff --git a/src/PollListBuilder.php b/src/PollListBuilder.php
index 0d6116b..bc4adf8 100644
--- a/src/PollListBuilder.php
+++ b/src/PollListBuilder.php
@@ -25,7 +25,7 @@ public function load() {
 
     // Sort the entities using the entity class's sort() method.
     // See \Drupal\Core\Config\Entity\ConfigEntityBase::sort().
-    uasort($entities, array($this->entityType->getClass(), 'sort'));
+    uasort($entities, [$this->entityType->getClass(), 'sort']);
     return $entities;
   }
 
@@ -58,10 +58,10 @@ public function buildRow(EntityInterface $entity) {
     $vote_storage = \Drupal::service('poll_vote.storage');
 
     $row['question'] = $entity->link($entity->label());
-    $row['author']['data'] = array(
+    $row['author']['data'] = [
       '#theme' => 'username',
       '#account' => $entity->getOwner(),
-    );
+    ];
     // $row['votes'] = $vote_storage->getTotalVotes($entity);
     $row['status'] = ($entity->isOpen()) ? t('Y') : t('N');
     $row['created'] = ($entity->getCreated()) ? Drupal::service('date.formatter')
diff --git a/src/PollViewBuilder.php b/src/PollViewBuilder.php
index 0915e64..79030f0 100644
--- a/src/PollViewBuilder.php
+++ b/src/PollViewBuilder.php
@@ -23,12 +23,12 @@ public function view(EntityInterface $entity, $view_mode = 'full', $langcode = N
     }
 
     $output = parent::view($entity, $view_mode, $langcode);
-    $output['#theme_wrappers'] = array('container');
+    $output['#theme_wrappers'] = ['container'];
     $output['#attributes']['class'][] = 'poll-view';
     $output['#attributes']['class'][] = $view_mode;
 
     $output['#poll'] = $entity;
-    $output['poll'] = array(
+    $output['poll'] = [
       '#lazy_builder' => [
         'poll.post_render_cache:renderViewForm',
         [
@@ -41,7 +41,7 @@ public function view(EntityInterface $entity, $view_mode = 'full', $langcode = N
       '#cache' => [
         'tags' => $entity->getCacheTags(),
       ],
-    );
+    ];
 
     return $output;
 
diff --git a/src/PollViewData.php b/src/PollViewData.php
index 3d14fdb..2ee893d 100644
--- a/src/PollViewData.php
+++ b/src/PollViewData.php
@@ -15,23 +15,23 @@ class PollViewData extends EntityViewsData {
   public function getViewsData() {
     $data = parent::getViewsData();
 
-    $data['poll_field_data']['votes'] = array(
+    $data['poll_field_data']['votes'] = [
       'title' => 'Total votes',
       'help' => 'Displays the total number of votes.',
       'real field' => 'id',
-      'field' => array(
+      'field' => [
         'id' => 'poll_totalvotes',
-      ),
-    );
+      ],
+    ];
 
-    $data['poll_field_data']['status_with_runtime'] = array(
+    $data['poll_field_data']['status_with_runtime'] = [
       'title' => 'Active with runtime',
       'help' => 'Displays the status with runtime.',
       'real field' => 'id',
-      'field' => array(
+      'field' => [
         'id' => 'poll_status',
-      ),
-    );
+      ],
+    ];
 
     return $data;
   }
diff --git a/src/PollVoteStorage.php b/src/PollVoteStorage.php
index 93c7235..44af848 100644
--- a/src/PollVoteStorage.php
+++ b/src/PollVoteStorage.php
@@ -100,14 +100,14 @@ public function saveVote(array $options) {
    * {@inheritdoc}
    */
   public function getVotes(PollInterface $poll) {
-    $votes = array();
+    $votes = [];
     // Set votes for all options to 0
     $options = $poll->getOptions();
     foreach ($options as $id => $label) {
       $votes[$id] = 0;
     }
 
-    $result = $this->connection->query("SELECT chid, COUNT(chid) AS votes FROM {poll_vote} WHERE pid = :pid GROUP BY chid", array(':pid' => $poll->id()));
+    $result = $this->connection->query("SELECT chid, COUNT(chid) AS votes FROM {poll_vote} WHERE pid = :pid GROUP BY chid", [':pid' => $poll->id()]);
     // Replace the count for options that have recorded votes in the database.
     foreach ($result as $row) {
       $votes[$row->chid] = $row->votes;
@@ -123,16 +123,16 @@ public function getUserVote(PollInterface $poll) {
     $uid = \Drupal::currentUser()->id();
     if ($uid || $poll->getAnonymousVoteAllow()) {
       if ($uid) {
-        $query = $this->connection->query("SELECT * FROM {poll_vote} WHERE pid = :pid AND uid = :uid", array(
+        $query = $this->connection->query("SELECT * FROM {poll_vote} WHERE pid = :pid AND uid = :uid", [
           ':pid' => $poll->id(),
           ':uid' => $uid
-        ));
+        ]);
       }
       else {
-        $query = $this->connection->query("SELECT * FROM {poll_vote} WHERE pid = :pid AND hostname = :hostname AND uid = 0", array(
+        $query = $this->connection->query("SELECT * FROM {poll_vote} WHERE pid = :pid AND hostname = :hostname AND uid = 0", [
           ':pid' => $poll->id(),
           ':hostname' => \Drupal::request()->getClientIp()
-        ));
+        ]);
       }
       return $query->fetchAssoc();
     }
@@ -143,7 +143,7 @@ public function getUserVote(PollInterface $poll) {
    * {@inheritdoc}
    */
   public function getTotalVotes(PollInterface $poll) {
-    $query = $this->connection->query("SELECT COUNT(chid) FROM {poll_vote} WHERE pid = :pid", array(':pid' => $poll->id()));
+    $query = $this->connection->query("SELECT COUNT(chid) FROM {poll_vote} WHERE pid = :pid", [':pid' => $poll->id()]);
     return $query->fetchField();
   }
 
