diff --git a/core/modules/comment/src/CommentTypeForm.php b/core/modules/comment/src/CommentTypeForm.php index bdde416182..3ab6a68924 100644 --- a/core/modules/comment/src/CommentTypeForm.php +++ b/core/modules/comment/src/CommentTypeForm.php @@ -74,7 +74,7 @@ public function form(array $form, FormStateInterface $form_state) { $comment_type = $this->entity; - if ($this->operation == 'edit') { + if ($this->operation === 'edit') { $form['#title'] = $this->t('Edit %label comment type', ['%label' => $comment_type->label()]); } diff --git a/core/modules/comment/src/Controller/CommentTypeController.php b/core/modules/comment/src/Controller/CommentTypeController.php index 0dc5c5d5a4..d9baeca9b6 100644 --- a/core/modules/comment/src/Controller/CommentTypeController.php +++ b/core/modules/comment/src/Controller/CommentTypeController.php @@ -4,6 +4,7 @@ use Drupal\comment\CommentTypeInterface; use Drupal\Core\Controller\ControllerBase; +use Drupal\Core\StringTranslation\TranslatableMarkup; /** * Returns responses for comment type routes. @@ -16,10 +17,10 @@ class CommentTypeController extends ControllerBase { * @param \Drupal\comment\CommentTypeInterface $comment_type * The comment type entity. * - * @return string + * @return string|\Drupal\Core\StringTranslation\TranslatableMarkup|null * The comment type title. */ - public function commentTypeTitle(CommentTypeInterface $comment_type) { + public function commentTypeTitle(CommentTypeInterface $comment_type): string|TranslatableMarkup|null { return $comment_type->label(); }