diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index 0a77456..185a233 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -2137,25 +2137,6 @@ function module_invoke($module, $hook) {
 }
 
 /**
- * Invokes a hook in all enabled modules that implement it.
- *
- * All arguments are passed by value. Use drupal_alter() if you need to pass
- * arguments by reference.
- *
- * @deprecated as of Drupal 8.0. Use
- *   \Drupal::moduleHandler()->invokeAll($hook).
- *
- * @see drupal_alter()
- * @see \Drupal\Core\Extension\ModuleHandler::invokeAll()
- */
-function module_invoke_all($hook) {
-  $args = func_get_args();
-  // Remove $hook from the arguments.
-  array_shift($args);
-  return \Drupal::moduleHandler()->invokeAll($hook, $args);
-}
-
-/**
  * Passes alterable variables to specific hook_TYPE_alter() implementations.
  *
  * @deprecated as of Drupal 8.0. Use
diff --git a/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php b/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php
index 809f186..e6e7d92 100644
--- a/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php
+++ b/core/lib/Drupal/Core/Config/Entity/ConfigStorageController.php
@@ -410,9 +410,9 @@ public function save(EntityInterface $entity) {
    */
   protected function invokeHook($hook, EntityInterface $entity) {
     // Invoke the hook.
-    module_invoke_all($this->entityType . '_' . $hook, $entity);
+    \Drupal::moduleHandler()->invokeAll($this->entityType . '_' . $hook, array($entity));
     // Invoke the respective entity-level hook.
-    module_invoke_all('entity_' . $hook, $entity, $this->entityType);
+    \Drupal::moduleHandler()->invokeAll('entity_' . $hook, array($entity, $this->entityType));
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
index fb19c4e..dd766fa 100644
--- a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
+++ b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
@@ -108,7 +108,7 @@ public function buildContent(array $entities, array $displays, $view_mode, $lang
       }
     }
 
-    module_invoke_all('entity_prepare_view', $this->entityType, $entities, $displays, $view_mode);
+    \Drupal::moduleHandler()->invokeAll('entity_prepare_view', array($this->entityType, $entities, $displays, $view_mode));
 
     foreach ($entities as $entity) {
       // Remove previously built content, if exists.
@@ -225,8 +225,8 @@ public function viewMultiple(array $entities = array(), $view_mode = 'full', $la
     foreach ($entities as $key => $entity) {
       $entity_view_mode = isset($entity->content['#view_mode']) ? $entity->content['#view_mode'] : $view_mode;
       $display = $displays[$entity_view_mode][$entity->bundle()];
-      module_invoke_all($view_hook, $entity, $display, $entity_view_mode, $langcode);
-      module_invoke_all('entity_view', $entity, $display, $entity_view_mode, $langcode);
+      \Drupal::moduleHandler()->invokeAll($view_hook, array($entity, $display, $entity_view_mode, $langcode));
+      \Drupal::moduleHandler()->invokeAll('entity_view', array($entity, $display, $entity_view_mode, $langcode));
 
       $build[$key] = $entity->content;
       // We don't need duplicate rendering info in $entity->content.
diff --git a/core/lib/Drupal/Core/Path/Path.php b/core/lib/Drupal/Core/Path/Path.php
index 4a3410f..ada1086 100644
--- a/core/lib/Drupal/Core/Path/Path.php
+++ b/core/lib/Drupal/Core/Path/Path.php
@@ -92,7 +92,7 @@ public function save($source, $alias, $langcode = Language::LANGCODE_NOT_SPECIFI
     }
     if ($pid) {
       // @todo Switch to using an event for this instead of a hook.
-      module_invoke_all($hook, $fields);
+      \Drupal::moduleHandler()->invokeAll($hook, array($fields));
       $this->alias_manager->cacheClear();
       return $fields;
     }
@@ -138,7 +138,7 @@ public function delete($conditions) {
     }
     $deleted = $query->execute();
     // @todo Switch to using an event for this instead of a hook.
-    module_invoke_all('path_delete', $path);
+    \Drupal::moduleHandler()->invokeAll('path_delete', array($path));
     $this->alias_manager->cacheClear();
     return $deleted;
   }
diff --git a/core/modules/comment/lib/Drupal/comment/Entity/Comment.php b/core/modules/comment/lib/Drupal/comment/Entity/Comment.php
index 6bcfd95..54b67cc 100644
--- a/core/modules/comment/lib/Drupal/comment/Entity/Comment.php
+++ b/core/modules/comment/lib/Drupal/comment/Entity/Comment.php
@@ -309,7 +309,7 @@ public function postSave(EntityStorageControllerInterface $storage_controller, $
     // Update the {comment_entity_statistics} table prior to executing the hook.
     $storage_controller->updateEntityStatistics($this);
     if ($this->status->value == CommentInterface::PUBLISHED) {
-      module_invoke_all('comment_publish', $this);
+      \Drupal::moduleHandler()->invokeAll('comment_publish', array($this));
     }
   }
 
diff --git a/core/modules/comment/tests/Drupal/comment/Tests/Entity/CommentLockTest.php b/core/modules/comment/tests/Drupal/comment/Tests/Entity/CommentLockTest.php
index 1005301..f002967 100644
--- a/core/modules/comment/tests/Drupal/comment/Tests/Entity/CommentLockTest.php
+++ b/core/modules/comment/tests/Drupal/comment/Tests/Entity/CommentLockTest.php
@@ -4,7 +4,7 @@
  * Contains \Drupal\comment\Tests\Entity\CommentTest
  */
 
-namespace Drupal\comment\Tests\Entity {
+namespace Drupal\comment\Tests\Entity;
 
 use Drupal\comment\Entity\Comment;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
@@ -33,6 +33,7 @@ public static function getInfo() {
    */
   public function testLocks() {
     $container = new ContainerBuilder();
+    $container->set('module_handler', $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface'));
     $container->set('current_user', $this->getMock('Drupal\Core\Session\AccountInterface'));
     $container->register('request', 'Symfony\Component\HttpFoundation\Request');
     $lock = $this->getMock('Drupal\Core\Lock\LockBackendInterface');
@@ -75,10 +76,3 @@ public function testLocks() {
   }
 
 }
-}
-namespace {
-if (!function_exists('module_invoke_all')) {
-  function module_invoke_all() {}
-}
-}
-
diff --git a/core/modules/editor/lib/Drupal/editor/Entity/Editor.php b/core/modules/editor/lib/Drupal/editor/Entity/Editor.php
index 27346c9..f47fe1f 100644
--- a/core/modules/editor/lib/Drupal/editor/Entity/Editor.php
+++ b/core/modules/editor/lib/Drupal/editor/Entity/Editor.php
@@ -75,7 +75,7 @@ public function __construct(array $values, $entity_type) {
 
     // Initialize settings, merging module-provided defaults.
     $default_settings = $plugin->getDefaultSettings();
-    $default_settings += module_invoke_all('editor_default_settings', $this->editor);
+    $default_settings += \Drupal::moduleHandler()->invokeAll('editor_default_settings', array($this->editor));
     drupal_alter('editor_default_settings', $default_settings, $this->editor);
     $this->settings += $default_settings;
   }
diff --git a/core/modules/entity/lib/Drupal/entity/EntityDisplayBase.php b/core/modules/entity/lib/Drupal/entity/EntityDisplayBase.php
index afda40a..401748e 100644
--- a/core/modules/entity/lib/Drupal/entity/EntityDisplayBase.php
+++ b/core/modules/entity/lib/Drupal/entity/EntityDisplayBase.php
@@ -309,7 +309,7 @@ public function getHighestWeight() {
     }
 
     // Let other modules feedback about their own additions.
-    $weights = array_merge($weights, module_invoke_all('field_info_max_weight', $this->targetEntityType, $this->bundle, $this->displayContext, $this->mode));
+    $weights = array_merge($weights, \Drupal::moduleHandler()->invokeAll('field_info_max_weight', array($this->targetEntityType, $this->bundle, $this->displayContext, $this->mode)));
 
     return $weights ? max($weights) : NULL;
   }
diff --git a/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php b/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php
index fa0d2cc..7da7e8d 100644
--- a/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php
+++ b/core/modules/filter/lib/Drupal/filter/Entity/FilterFormat.php
@@ -180,7 +180,7 @@ public function disable() {
     parent::disable();
 
     // Allow modules to react on text format deletion.
-    module_invoke_all('filter_format_disable', $this);
+    \Drupal::moduleHandler()->invokeAll('filter_format_disable', array($this));
 
     // Clear the filter cache whenever a text format is disabled.
     filter_formats_reset();
diff --git a/core/modules/node/lib/Drupal/node/NodeFormController.php b/core/modules/node/lib/Drupal/node/NodeFormController.php
index 1cc58a7..3eddd17 100644
--- a/core/modules/node/lib/Drupal/node/NodeFormController.php
+++ b/core/modules/node/lib/Drupal/node/NodeFormController.php
@@ -329,7 +329,7 @@ public function validate(array $form, array &$form_state) {
     }
 
     // Invoke hook_node_validate() for validation needed by modules.
-    // Can't use module_invoke_all(), because $form_state must
+    // Can't use \Drupal::moduleHandler()->invokeAll(), because $form_state must
     // be receivable by reference.
     foreach (\Drupal::moduleHandler()->getImplementations('node_validate') as $module) {
       $function = $module . '_node_validate';
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/UnitTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/UnitTestBase.php
index 86a7254..bde2b18 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/UnitTestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/UnitTestBase.php
@@ -15,7 +15,8 @@
  *
  * These tests can not access the database nor files. Calling any Drupal
  * function that needs the database will throw exceptions. These include
- * watchdog(), \Drupal::moduleHandler()->getImplementations(), module_invoke_all() etc.
+ * watchdog(), \Drupal::moduleHandler()->getImplementations(),
+ * \Drupal::moduleHandler()->invokeAll() etc.
  */
 abstract class UnitTestBase extends TestBase {
 
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
index 9d17cac..3bce0fb 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
@@ -586,7 +586,7 @@ protected function checkPermissions(array $permissions, $reset = FALSE) {
     $available = &drupal_static(__FUNCTION__);
 
     if (!isset($available) || $reset) {
-      $available = array_keys(module_invoke_all('permission'));
+      $available = array_keys(\Drupal::moduleHandler()->invokeAll('permission'));
     }
 
     $valid = TRUE;
diff --git a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php
index 6d7699a..5d926b4 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Menu/BreadcrumbTest.php
@@ -37,7 +37,7 @@ public static function getInfo() {
   function setUp() {
     parent::setUp();
 
-    $perms = array_keys(module_invoke_all('permission'));
+    $perms = array_keys(\Drupal::moduleHandler()->invokeAll('permission'));
     $this->admin_user = $this->drupalCreateUser($perms);
     $this->drupalLogin($this->admin_user);
 
diff --git a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php
index 0d184b6..bcd2253 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Module/ModuleApiTest.php
@@ -127,13 +127,13 @@ function testModuleInvoke() {
   }
 
   /**
-   * Test that module_invoke_all() can load a hook defined in hook_hook_info().
+   * Test that \Drupal::moduleHandler()->invokeAll() can load a hook defined in hook_hook_info().
    */
   function testModuleInvokeAll() {
     \Drupal::moduleHandler()->install(array('module_test'), FALSE);
     $this->resetAll();
     $this->drupalGet('module-test/hook-dynamic-loading-invoke-all');
-    $this->assertText('success!', 'module_invoke_all() dynamically loads a hook defined in hook_hook_info().');
+    $this->assertText('success!', '\Drupal::moduleHandler()->invokeAll() dynamically loads a hook defined in hook_hook_info().');
   }
 
   /**
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/AdminTest.php b/core/modules/system/lib/Drupal/system/Tests/System/AdminTest.php
index 2ecd632..900a4fa 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/AdminTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/AdminTest.php
@@ -36,7 +36,7 @@ function setUp() {
     // Create an administrator with all permissions, as well as a regular user
     // who can only access administration pages and perform some Locale module
     // administrative tasks, but not all of them.
-    $this->admin_user = $this->drupalCreateUser(array_keys(module_invoke_all('permission')));
+    $this->admin_user = $this->drupalCreateUser(array_keys(\Drupal::moduleHandler()->invokeAll('permission')));
     $this->web_user = $this->drupalCreateUser(array(
       'access administration pages',
       'translate interface',
diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/access/Permission.php b/core/modules/user/lib/Drupal/user/Plugin/views/access/Permission.php
index 2251a6e..ebb236f 100644
--- a/core/modules/user/lib/Drupal/user/Plugin/views/access/Permission.php
+++ b/core/modules/user/lib/Drupal/user/Plugin/views/access/Permission.php
@@ -44,7 +44,7 @@ public function alterRouteDefinition(Route $route) {
   }
 
   public function summaryTitle() {
-    $permissions = module_invoke_all('permission');
+    $permissions = \Drupal::moduleHandler()->invokeAll('permission');
     if (isset($permissions[$this->options['perm']])) {
       return $permissions[$this->options['perm']]['title'];
     }
