mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-17 08:29:31 +00:00
Fixed some inspection issues.
This commit is contained in:
parent
eef26f7ae6
commit
639829f5c5
97 changed files with 305 additions and 185 deletions
|
|
@ -24,6 +24,7 @@ declare(strict_types=1);
|
|||
namespace App\Services\LabelSystem\PlaceholderProviders;
|
||||
|
||||
use App\Entity\UserSystem\User;
|
||||
use DateTime;
|
||||
use IntlDateFormatter;
|
||||
use Locale;
|
||||
use Symfony\Component\Security\Core\Security;
|
||||
|
|
@ -65,7 +66,7 @@ final class GlobalProviders implements PlaceholderProviderInterface
|
|||
return 'anonymous';
|
||||
}
|
||||
|
||||
$now = new \DateTime();
|
||||
$now = new DateTime();
|
||||
|
||||
if ('[[DATETIME]]' === $placeholder) {
|
||||
$formatter = IntlDateFormatter::create(
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ namespace App\Services\LabelSystem\PlaceholderProviders;
|
|||
|
||||
use App\Entity\Parts\Part;
|
||||
use App\Services\SIFormatter;
|
||||
use Parsedown;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
final class PartProvider implements PlaceholderProviderInterface
|
||||
|
|
@ -88,7 +89,7 @@ final class PartProvider implements PlaceholderProviderInterface
|
|||
return $this->translator->trans('m_status.'.$part->getManufacturingStatus());
|
||||
}
|
||||
|
||||
$parsedown = new \Parsedown();
|
||||
$parsedown = new Parsedown();
|
||||
|
||||
if ('[[DESCRIPTION]]' === $placeholder) {
|
||||
return $parsedown->line($part->getDescription());
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ declare(strict_types=1);
|
|||
namespace App\Services\LabelSystem\PlaceholderProviders;
|
||||
|
||||
use App\Entity\Contracts\TimeStampableInterface;
|
||||
use DateTime;
|
||||
use IntlDateFormatter;
|
||||
use Locale;
|
||||
|
||||
|
|
@ -35,11 +36,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 DateTime());
|
||||
}
|
||||
|
||||
if ('[[CREATION_DATE]]' === $placeholder) {
|
||||
return $formatter->format($label_target->getAddedDate() ?? new \DateTime());
|
||||
return $formatter->format($label_target->getAddedDate() ?? new DateTime());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue