bueltge/marksimple

View on GitHub
src/Rule/AbstractRegexRule.php

Summary

Maintainability
A
0 mins
Test Coverage
<?php

declare(strict_types=1);

namespace Bueltge\Marksimple\Rule;

abstract class AbstractRegexRule implements RegexRuleInterface
{
    /**
     * {@inheritdoc}
     */
    public function parse(string $content): string
    {
        return preg_replace_callback($this->rule(), [$this, 'render'], $content);
    }

    abstract protected function render(array $content): string;
}