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

@ -49,11 +49,8 @@ use App\Services\LabelSystem\PlaceholderProviders\PlaceholderProviderInterface;
*/
final class LabelTextReplacer
{
private iterable $providers;
public function __construct(iterable $providers)
public function __construct(private readonly iterable $providers)
{
$this->providers = $providers;
}
/**
@ -89,9 +86,7 @@ final class LabelTextReplacer
public function replace(string $lines, object $target): string
{
$patterns = [
'/(\[\[[A-Z_0-9]+\]\])/' => function ($match) use ($target) {
return $this->handlePlaceholder($match[0], $target);
},
'/(\[\[[A-Z_0-9]+\]\])/' => fn($match) => $this->handlePlaceholder($match[0], $target),
];
return preg_replace_callback_array($patterns, $lines);