mirror of
https://github.com/kevachat/webapp.git
synced 2025-01-10 14:58:02 +00:00
remove deprecated methods
This commit is contained in:
parent
c16c071952
commit
4063fabf30
@ -52,20 +52,6 @@ class AppExtension extends AbstractExtension
|
||||
'mentionToMarkdown'
|
||||
]
|
||||
),
|
||||
new TwigFilter(
|
||||
'url_to_html',
|
||||
[
|
||||
$this,
|
||||
'urlToHtml'
|
||||
]
|
||||
),
|
||||
new TwigFilter(
|
||||
'mention_to_html',
|
||||
[
|
||||
$this,
|
||||
'mentionToHtml'
|
||||
]
|
||||
),
|
||||
new TwigFilter(
|
||||
'keva_namespace_value',
|
||||
[
|
||||
@ -184,28 +170,6 @@ class AppExtension extends AbstractExtension
|
||||
);
|
||||
}
|
||||
|
||||
public function urlToHtml(
|
||||
string $text
|
||||
): string
|
||||
{
|
||||
return preg_replace(
|
||||
'~(https?://(?:www\.)?[^\(\s\)]+)~i',
|
||||
'<a href="$1">$1</a>',
|
||||
$text
|
||||
);
|
||||
}
|
||||
|
||||
public function mentionToHtml(
|
||||
string $text
|
||||
): string
|
||||
{
|
||||
return preg_replace(
|
||||
'~@([A-z0-9]{64})~i',
|
||||
'<a href="#$1">@$1</a>',
|
||||
$text
|
||||
);
|
||||
}
|
||||
|
||||
private function plural(int $number, array $texts)
|
||||
{
|
||||
$cases = [2, 0, 1, 1, 1, 2];
|
||||
|
Loading…
Reference in New Issue
Block a user