Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/FileUpdater.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading