24 lines
475 B
PHP
24 lines
475 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
function telegramServiceFooter(): string
|
|
{
|
|
return 'Ein Service des Astronomiemuseums der Sternwarte Sonneberg';
|
|
}
|
|
|
|
function appendTelegramServiceFooter(string $text): string
|
|
{
|
|
$footer = telegramServiceFooter();
|
|
$trimmedText = trim($text);
|
|
|
|
if ($trimmedText === '') {
|
|
return $footer;
|
|
}
|
|
|
|
if (str_contains($trimmedText, $footer)) {
|
|
return $trimmedText;
|
|
}
|
|
|
|
return $trimmedText . "\n\n" . $footer;
|
|
}
|