mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-30 13:34:28 +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
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue