|
|
@ -52,7 +52,7 @@ class AppExtension extends AbstractExtension |
|
|
|
public function formatBytes( |
|
|
|
public function formatBytes( |
|
|
|
int $bytes, |
|
|
|
int $bytes, |
|
|
|
int $precision = 2 |
|
|
|
int $precision = 2 |
|
|
|
) : string |
|
|
|
): string |
|
|
|
{ |
|
|
|
{ |
|
|
|
$size = [ |
|
|
|
$size = [ |
|
|
|
$this->translator->trans('B'), |
|
|
|
$this->translator->trans('B'), |
|
|
@ -73,7 +73,7 @@ class AppExtension extends AbstractExtension |
|
|
|
|
|
|
|
|
|
|
|
public function formatAgo( |
|
|
|
public function formatAgo( |
|
|
|
int $time, |
|
|
|
int $time, |
|
|
|
) : string |
|
|
|
): string |
|
|
|
{ |
|
|
|
{ |
|
|
|
$diff = time() - $time; |
|
|
|
$diff = time() - $time; |
|
|
|
|
|
|
|
|
|
|
@ -144,7 +144,7 @@ class AppExtension extends AbstractExtension |
|
|
|
|
|
|
|
|
|
|
|
public function urlToMarkdown( |
|
|
|
public function urlToMarkdown( |
|
|
|
string $text |
|
|
|
string $text |
|
|
|
) : string |
|
|
|
): string |
|
|
|
{ |
|
|
|
{ |
|
|
|
return preg_replace( |
|
|
|
return preg_replace( |
|
|
|
'~(https?://(?:www\.)?[^\s]+)~i', |
|
|
|
'~(https?://(?:www\.)?[^\s]+)~i', |
|
|
|