Is there an error in Drupal with hook_views_post_execute?
You have to define the statement of ViewExecutable like use \Drupal\views\ViewExecutable

use \Drupal\views\ViewExecutable;

function nvgh_views_post_execute(ViewExecutable $view) {
  if ($view-&gt;total_rows &gt; 12) {
    \Drupal::messenger()
      -&gt;addStatus(t('You have more than 100 hits. Use the filter settings to narrow down your list.'));
  }
}