|
1234567891011121314151617181920212223242526272829303132 |
- <?php
-
- namespace App\BbCode\Tag;
-
- use Knockout\BbCode\Tag\TagInterface;
- use Knockout\BbCode\Tokenizer\Tag as TokenTag;
-
- class Unknown implements TagInterface
- {
-
- public function format(TokenTag $tokenTag) : string
- {
- $formattedString = "[{$tokenTag->getType()}";
-
- if ($tokenTag->getArgument()) {
- $formattedString .= " {$tokenTag->getArgument()}";
- }
-
- $formattedString .= "]{$tokenTag->getText()}[/{$tokenTag->getType()}]";
- return $formattedString;
- }
-
- public function getName(): string
- {
- return '';
- }
-
- public function getOriginalText(TokenTag $tokenTag): string
- {
- return "[{$tokenTag->getType()}]{$tokenTag->getText()}[/{$tokenTag->getType()}]";
- }
- }
|