*/ final class WrapHandler { private $before; private $after; public function __construct($before, $after) { $this->before = $before; $this->after = $after; } public static function createBold() { return new self('', ''); } /** * [b]content[b] * [strong]content[/strong] * * @param ShortcodeInterface $shortcode * * @return string */ public function __invoke(ShortcodeInterface $shortcode) { return $this->before.$shortcode->getContent().$this->after; } }