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

Add safe mode and strict mode configurables

This commit is contained in:
Aidan Woods 2019-01-20 02:18:43 +00:00
parent 072f91df47
commit c55dbb0d3f
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9
2 changed files with 58 additions and 0 deletions

View File

@ -0,0 +1,29 @@
<?php
namespace Erusev\Parsedown\Configurables;
use Erusev\Parsedown\Configurable;
final class SafeMode implements Configurable
{
/** @var bool */
private $enabled = false;
/**
* @param bool $enabled
*/
public function __construct($enabled)
{
$this->enabled = $enabled;
}
public function enabled(): bool
{
return $this->enabled;
}
public static function default(): self
{
return new self(false);
}
}

View File

@ -0,0 +1,29 @@
<?php
namespace Erusev\Parsedown\Configurables;
use Erusev\Parsedown\Configurable;
final class StrictMode implements Configurable
{
/** @var bool */
private $enabled = false;
/**
* @param bool $enabled
*/
public function __construct($enabled)
{
$this->enabled = $enabled;
}
public function enabled(): bool
{
return $this->enabled;
}
public static function default(): self
{
return new self(false);
}
}