Applied rector with PHP8.1 migration rules

This commit is contained in:
Jan Böhmer 2023-06-11 14:15:46 +02:00
parent dc6a67c2f0
commit 7ee01d9a05
303 changed files with 1228 additions and 3465 deletions

View file

@ -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');
}