diff --git a/file_example/src/Form/FileExampleReadWriteForm.php b/file_example/src/Form/FileExampleReadWriteForm.php
index 57bfeea..d7a9121 100644
--- a/file_example/src/Form/FileExampleReadWriteForm.php
+++ b/file_example/src/Form/FileExampleReadWriteForm.php
@@ -771,11 +771,7 @@ class FileExampleReadWriteForm extends FormBase {
     $form_values = $form_state->getValues();
     // If the devel module is installed, use it's nicer message format.
     if ($this->moduleHandler->moduleExists('devel')) {
-      // @codingStandardsIgnoreStart
-      // We wrap this in the coding standards ignore tags because the use of
-      // function dsm() is discouraged.
-      dsm($this->getStoredData(), $this->t('Entire $_SESSION["file_example"]'));
-      // @codingStandardsIgnoreEnd
+      \Drupal::service('devel.dumper')->message($this->getStoredData(), $this->t('Entire $_SESSION["file_example"]'));
     }
     else {
       $this->messenger()->addMessage(print_r($this->getStoredData(), TRUE));
