mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-11 02:44:32 +02:00
Applied rector with PHP8.1 migration rules
This commit is contained in:
parent
dc6a67c2f0
commit
7ee01d9a05
303 changed files with 1228 additions and 3465 deletions
|
@ -52,29 +52,13 @@ use Twig\Error\Error;
|
|||
|
||||
final class LabelHTMLGenerator
|
||||
{
|
||||
private Environment $twig;
|
||||
private ElementTypeNameGenerator $elementTypeNameGenerator;
|
||||
private LabelTextReplacer $replacer;
|
||||
private BarcodeGenerator $barcodeGenerator;
|
||||
private SandboxedTwigProvider $sandboxedTwigProvider;
|
||||
private string $partdb_title;
|
||||
private \Symfony\Bundle\SecurityBundle\Security $security;
|
||||
|
||||
public function __construct(ElementTypeNameGenerator $elementTypeNameGenerator, LabelTextReplacer $replacer, Environment $twig,
|
||||
BarcodeGenerator $barcodeGenerator, SandboxedTwigProvider $sandboxedTwigProvider, \Symfony\Bundle\SecurityBundle\Security $security, string $partdb_title)
|
||||
public function __construct(private readonly ElementTypeNameGenerator $elementTypeNameGenerator, private readonly LabelTextReplacer $replacer, private readonly Environment $twig, private readonly BarcodeGenerator $barcodeGenerator, private readonly SandboxedTwigProvider $sandboxedTwigProvider, private readonly \Symfony\Bundle\SecurityBundle\Security $security, private readonly string $partdb_title)
|
||||
{
|
||||
$this->twig = $twig;
|
||||
$this->elementTypeNameGenerator = $elementTypeNameGenerator;
|
||||
$this->replacer = $replacer;
|
||||
$this->barcodeGenerator = $barcodeGenerator;
|
||||
$this->sandboxedTwigProvider = $sandboxedTwigProvider;
|
||||
$this->security = $security;
|
||||
$this->partdb_title = $partdb_title;
|
||||
}
|
||||
|
||||
public function getLabelHTML(LabelOptions $options, array $elements): string
|
||||
{
|
||||
if (empty($elements)) {
|
||||
if ($elements === []) {
|
||||
throw new InvalidArgumentException('$elements must not be empty');
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue