Skip to content
Snippets Groups Projects

Fix type of output property in ChannelPostRender

@@ -2,6 +2,7 @@
namespace Drupal\push_framework\Event;
use Drupal\Component\Render\MarkupInterface;
use Drupal\Core\Entity\ContentEntityInterface;
use Drupal\push_framework\ChannelPluginInterface;
use Drupal\user\UserInterface;
@@ -14,14 +15,14 @@ class ChannelPostRender extends ChannelEventLanguageBase {
/**
* The rendered notification message.
*
* @var string
* @var string|\Drupal\Component\Render\MarkupInterface
*/
protected string $output;
protected string|MarkupInterface $output;
/**
* {@inheritdoc}
*/
public function __construct(ChannelPluginInterface $channelPlugin, UserInterface $user, ContentEntityInterface $entity, string $displayMode, string $languageKey, string &$output) {
public function __construct(ChannelPluginInterface $channelPlugin, UserInterface $user, ContentEntityInterface $entity, string $displayMode, string $languageKey, string|MarkupInterface &$output) {
parent::__construct($channelPlugin, $user, $entity, $displayMode, $languageKey);
$this->output = &$output;
}
@@ -29,23 +30,23 @@ class ChannelPostRender extends ChannelEventLanguageBase {
/**
* Get the rendered notification message.
*
* @return string
* @return string|\Drupal\Component\Render\MarkupInterface
* The rendered notification message.
*/
public function getOutput(): string {
public function getOutput(): string|MarkupInterface {
return $this->output;
}
/**
* Set the rendered notification message.
*
* @param string $output
* @param string|\Drupal\Component\Render\MarkupInterface $output
* The rendered notification message.
*
* @return ChannelPostRender
* This.
*/
public function setOutput(string $output): ChannelPostRender {
public function setOutput(string|MarkupInterface $output): ChannelPostRender {
$this->output = $output;
return $this;
}
Loading