From 21e622cab2156c1eb0595cc4e8b4ed2a2255d444 Mon Sep 17 00:00:00 2001 From: Abderrahim Darghal Belkacemi Date: Mon, 25 Aug 2025 13:42:25 +0200 Subject: [PATCH] fix: parche aplicado para el bug --- src/FileUpdater.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/FileUpdater.php b/src/FileUpdater.php index d07e55a..bd44303 100644 --- a/src/FileUpdater.php +++ b/src/FileUpdater.php @@ -275,8 +275,12 @@ public static function upgradePhpFiles(): void $fileStr = preg_replace('/\$this->previousData\[([^\]]+)\]/', '$this->getOriginal($1)', $fileStr); // reemplazamos llamadas al método all() con 3 parámetros añadiendo el 4º parámetro (50) - $fileStr = preg_replace('/->all\(([^,]+),\s*([^,]+),\s*([^)]+)\)/', '->all($1, $2, $3, 50)', $fileStr); - $fileStr = preg_replace('/::all\(([^,]+),\s*([^,]+),\s*([^)]+)\)/', '::all($1, $2, $3, 50)', $fileStr); + // añade ", 50" solo cuando hay exactamente 3 argumentos + $fileStr = preg_replace( + '/(->|::)all\(\s*([^,()]+)\s*,\s*([^,()]+)\s*,\s*([^,()]+)\s*\)/', + '$1all($2, $3, $4, 50)', + $fileStr + ); // reemplazamos protected function onChange($field) por protected function onChange(string $field): bool $fileStr = str_replace('protected function onChange($field)', 'protected function onChange(string $field): bool', $fileStr);