<?php
/**
* Holds the tag base.
* @package Sakura
*/
namespace Sakura\BBCode;
use Sakura\User;
* Interface for tags.
* @author Julian van de Groep <me@flash.moe>
class TagBase
{
* The pattern to match.
* @var string
public static $pattern = "";
* The string to replace it with.
public static $replace = "";
* Parses the bbcode.
* @param string $text
* @param User $poster
* @return string
public static function parse(string $text, User $poster): string
return preg_replace(static::$pattern, static::$replace, $text);
}