You are here

protected function TestWebformHandler::displayMessage in Webform 6.x

Same name and namespace in other branches
  1. 8.5 tests/modules/webform_test_handler/src/Plugin/WebformHandler/TestWebformHandler.php \Drupal\webform_test_handler\Plugin\WebformHandler\TestWebformHandler::displayMessage()

Display the invoked plugin method to end user.

Parameters

string $method_name: The invoked method name.

string $context1: Additional parameter passed to the invoked method name.

23 calls to TestWebformHandler::displayMessage()
TestWebformHandler::access in tests/modules/webform_test_handler/src/Plugin/WebformHandler/TestWebformHandler.php
Controls entity operation access to webform submission.
TestWebformHandler::accessElement in tests/modules/webform_test_handler/src/Plugin/WebformHandler/TestWebformHandler.php
Controls entity operation access to webform submission element.
TestWebformHandler::alterElement in tests/modules/webform_test_handler/src/Plugin/WebformHandler/TestWebformHandler.php
Alter webform element.
TestWebformHandler::alterElements in tests/modules/webform_test_handler/src/Plugin/WebformHandler/TestWebformHandler.php
Alter webform submission webform elements.
TestWebformHandler::alterForm in tests/modules/webform_test_handler/src/Plugin/WebformHandler/TestWebformHandler.php
Alter webform submission form.

... See full list

File

tests/modules/webform_test_handler/src/Plugin/WebformHandler/TestWebformHandler.php, line 252

Class

TestWebformHandler
Webform submission test handler.

Namespace

Drupal\webform_test_handler\Plugin\WebformHandler

Code

protected function displayMessage($method_name, $context1 = NULL) {
  if (PHP_SAPI !== 'cli') {
    $t_args = [
      '@id' => $this
        ->getHandlerId(),
      '@class_name' => get_class($this),
      '@method_name' => $method_name,
      '@context1' => $context1,
    ];
    $this
      ->messenger()
      ->addStatus($this
      ->t('Invoked @id: @class_name:@method_name @context1', $t_args), TRUE);
    $this->loggerFactory
      ->get('webform.test_form')
      ->notice('Invoked: @class_name:@method_name @context1', $t_args);
  }
}