diff --git a/core/modules/system/core.api.php b/core/modules/system/core.api.php
index ecbb006cead1e4535d6800e389eeeadba608402d..0503464c7fecf1277f16d8b21f0a95fa31957168 100644
--- a/core/modules/system/core.api.php
+++ b/core/modules/system/core.api.php
@@ -533,6 +533,7 @@
  * $query \Drupal::entityQueryAggregate('your_entity_type');
  * // Or:
  * $query = $query_service->getAggregate('your_entity_type');
+ * @endcode
  * Also, you should use dependency injection to get this object if
  * possible; the service you need is entity.query, and its methods getQuery()
  * or getAggregateQuery() will get the query object.