mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-07-31 13:41:37 +00:00
Fixed coding style.
This commit is contained in:
parent
e9493e52ec
commit
f5d685dfd4
71 changed files with 619 additions and 531 deletions
|
|
@ -1,4 +1,7 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
|
||||
*
|
||||
|
|
@ -20,7 +23,6 @@
|
|||
|
||||
namespace App\Services\LabelSystem\PlaceholderProviders;
|
||||
|
||||
|
||||
use App\Entity\Base\AbstractDBElement;
|
||||
use App\Services\ElementTypeNameGenerator;
|
||||
|
||||
|
|
@ -33,23 +35,18 @@ final class AbstractDBElementProvider implements PlaceholderProviderInterface
|
|||
$this->elementTypeNameGenerator = $elementTypeNameGenerator;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function replace(string $placeholder, object $label_target, array $options = []): ?string
|
||||
{
|
||||
if ($label_target instanceof AbstractDBElement) {
|
||||
|
||||
if ($placeholder === '[[TYPE]]') {
|
||||
if ('[[TYPE]]' === $placeholder) {
|
||||
return $this->elementTypeNameGenerator->getLocalizedTypeLabel($label_target);
|
||||
}
|
||||
|
||||
if ($placeholder === '[[ID]]') {
|
||||
if ('[[ID]]' === $placeholder) {
|
||||
return (string) ($label_target->getID() ?? 'unknown');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue