text; if ($text === null) $text = static::TEXT; return $text; } const TEXT = ""; function __construct(?array $data=null) { parent::__construct($data); $this->context = $this; } /** @var string */ protected $text; function setText(string $text): void { $this->text = $text; } /** retourner le texte avec les variables renseignées */ function apply() { $text = $this->TEXT(); $context = $this->getContext(); return $this->applyRules($text, $context); } }