 core/modules/comment/comment.module                 |   17 -----------------
 .../FieldFormatter/CommentDefaultFormatter.php      |   19 ++++++++++++++++++-
 2 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index 6189c72..6fcbc2b 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -1731,20 +1731,3 @@ function comment_library_info() {
   );
   return $libraries;
 }
-
-/**
- * #post_render_cache callback; replaces the placeholder with the comment form.
- *
- * @param array $context
- *   An array with the following keys:
- *   - entity_type: an entity type
- *   - entity_id: an entity ID
- *   - field_name: a comment field name
- *
- * @return array $element
- *   The updated $element.
- */
-function comment_replace_form_placeholder(array $context) {
-  $entity = entity_load($context['entity_type'], $context['entity_id']);
-  return comment_add($entity, $context['field_name']);
-}
diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php b/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php
index 4ae0c45..0e1ad3d 100644
--- a/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php
+++ b/core/modules/comment/lib/Drupal/comment/Plugin/Field/FieldFormatter/CommentDefaultFormatter.php
@@ -151,7 +151,7 @@ public function viewElements(FieldItemListInterface $items) {
           else {
             $output['comment_form'] = array(
               '#type' => 'render_cache_placeholder',
-              '#callback' => 'comment_replace_form_placeholder',
+              '#callback' => 'Drupal\comment\Plugin\Field\FieldFormatter\CommentDefaultFormatter::renderForm',
               '#context' => array(
                 'entity_type' => $entity->entityType(),
                 'entity_id' => $entity->id(),
@@ -174,4 +174,21 @@ public function viewElements(FieldItemListInterface $items) {
     return $elements;
   }
 
+  /**
+   * #post_render_cache callback; replaces placeholder with comment form.
+   *
+   * @param array $context
+   *   An array with the following keys:
+   *   - entity_type: an entity type
+   *   - entity_id: an entity ID
+   *   - field_name: a comment field name
+   *
+   * @return array
+   *   The updated $element.
+   */
+  public static function renderForm(array $context) {
+    $entity = entity_load($context['entity_type'], $context['entity_id']);
+    return comment_add($entity, $context['field_name']);
+  }
+
 }
