1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

Add canonical state renderable to provide default implementation for

renderables to be trivially state renderable
This commit is contained in:
Aidan Woods 2019-01-20 02:15:07 +00:00
parent 23560bfa33
commit 23cfbd153c
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9
2 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,17 @@
<?php
namespace Erusev\Parsedown\Html\Renderables;
use Erusev\Parsedown\Html\Renderable;
use Erusev\Parsedown\State;
trait CanonicalStateRenderable
{
/**
* @return Renderable
*/
public function renderable(State $State)
{
return $this;
}
}

View File

@ -7,6 +7,8 @@ use Erusev\Parsedown\Html\Sanitisation\Escaper;
final class Text implements Renderable
{
use CanonicalStateRenderable;
/** @var string */
private $text;