Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
InterpretationMediator.php
Go to the documentation of this file.
1 <?php
7 
9 
11 {
15  private $interpretationStrategy;
16 
20  public function __construct(
21  InterpretationStrategy $interpretationStrategy
22  ) {
23  $this->interpretationStrategy = $interpretationStrategy;
24  }
25 
33  {
34  if ($message->getIdentifier()) {
35  try {
36  return $this->interpretationStrategy->interpret($message);
37  } catch (\LogicException $e) {
38  // pass
39  }
40  }
41 
42  return $message->getText();
43  }
44 }
$message
__construct(InterpretationStrategy $interpretationStrategy)