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

Add traits to provide common block implementations

This commit is contained in:
Aidan Woods 2019-01-20 02:24:04 +00:00
parent 74a855946d
commit 3094329950
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9
2 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,15 @@
<?php
namespace Erusev\Parsedown\Components\Blocks;
trait BlockAcquisition
{
/** @var bool */
private $acquired = false;
/** @return bool */
public function acquiredPrevious()
{
return $this->acquired;
}
}

View File

@ -0,0 +1,28 @@
<?php
namespace Erusev\Parsedown\Components\Blocks;
trait ContinuableBlockDefaultInterrupt
{
/** @var bool */
private $interrupted = false;
/**
* @param bool $isInterrupted
*/
public function interrupted($isInterrupted)
{
$New = clone($this);
$New->interrupted = $isInterrupted;
return $New;
}
/**
* @return bool
*/
public function isInterrupted()
{
return $this->interrupted;
}
}