mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-05-21 10:51:38 +00:00
Merge branch 'master' into settings-bundle
This commit is contained in:
commit
3e657a7cac
305 changed files with 7543 additions and 4274 deletions
|
|
@ -86,7 +86,7 @@ final class GlobalProviders implements PlaceholderProviderInterface
|
|||
return 'anonymous';
|
||||
}
|
||||
|
||||
$now = new DateTime();
|
||||
$now = new \DateTimeImmutable();
|
||||
|
||||
if ('[[DATETIME]]' === $placeholder) {
|
||||
$formatter = IntlDateFormatter::create(
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ final class PartProvider implements PlaceholderProviderInterface
|
|||
}
|
||||
|
||||
if ('[[DESCRIPTION_T]]' === $placeholder) {
|
||||
return strip_tags($parsedown->line($part->getDescription()));
|
||||
return strip_tags((string) $parsedown->line($part->getDescription()));
|
||||
}
|
||||
|
||||
if ('[[COMMENT]]' === $placeholder) {
|
||||
|
|
@ -127,7 +127,7 @@ final class PartProvider implements PlaceholderProviderInterface
|
|||
}
|
||||
|
||||
if ('[[COMMENT_T]]' === $placeholder) {
|
||||
return strip_tags($parsedown->line($part->getComment()));
|
||||
return strip_tags((string) $parsedown->line($part->getComment()));
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ final class StructuralDBElementProvider implements PlaceholderProviderInterface
|
|||
return $label_target->getComment();
|
||||
}
|
||||
if ('[[COMMENT_T]]' === $placeholder) {
|
||||
return strip_tags($label_target->getComment());
|
||||
return strip_tags((string) $label_target->getComment());
|
||||
}
|
||||
if ('[[FULL_PATH]]' === $placeholder) {
|
||||
return $label_target->getFullPath();
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ declare(strict_types=1);
|
|||
namespace App\Services\LabelSystem\PlaceholderProviders;
|
||||
|
||||
use App\Entity\Contracts\TimeStampableInterface;
|
||||
use DateTime;
|
||||
use IntlDateFormatter;
|
||||
use Locale;
|
||||
|
||||
|
|
@ -57,11 +56,11 @@ final class TimestampableElementProvider implements PlaceholderProviderInterface
|
|||
$formatter = new IntlDateFormatter(Locale::getDefault(), IntlDateFormatter::SHORT, IntlDateFormatter::SHORT);
|
||||
|
||||
if ('[[LAST_MODIFIED]]' === $placeholder) {
|
||||
return $formatter->format($label_target->getLastModified() ?? new DateTime());
|
||||
return $formatter->format($label_target->getLastModified() ?? new \DateTimeImmutable());
|
||||
}
|
||||
|
||||
if ('[[CREATION_DATE]]' === $placeholder) {
|
||||
return $formatter->format($label_target->getAddedDate() ?? new DateTime());
|
||||
return $formatter->format($label_target->getAddedDate() ?? new \DateTimeImmutable());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue