This PR refactors the handle() functions in GedcomExporter.php and GedcomImporter.php to improve code readability, maintainability, and testability. The goal is to break down the large functions into smaller, more modular functions that have clear responsibilities.
Summary of Changes
In GedcomExporter.php:
Extracted the code from lines 44-81 into a new function called exportData().
Modified the handle() function to call the exportData() function.
Created a new file called GedcomExporter.php in the src/Utils directory.
Added the necessary namespace declaration and imports.
Defined a class called GedcomExporter with a public static function exportData() that takes the necessary parameters.
Moved the code extracted from GedcomExporter.php handle() function (lines 44-81) into the exportData() function.
In GedcomImporter.php:
Extracted the code from lines 41-42 into a new function called importData().
Modified the handle() function to call the importData() function.
Created a new file called GedcomImporter.php in the src/Utils directory.
Added the necessary namespace declaration and imports.
Defined a class called GedcomImporter with a public static function importData() that takes the necessary parameters.
Moved the code extracted from GedcomImporter.php handle() function (lines 41-42) into the importData() function.
These changes improve the code structure by breaking down the large handle() functions into smaller, more modular functions. This enhances code readability, maintainability, and testability.
PR Feedback (click)
I created this PR to address this rule:
"Refactor large functions to be more modular."
Description
This PR refactors the handle() functions in GedcomExporter.php and GedcomImporter.php to improve code readability, maintainability, and testability. The goal is to break down the large functions into smaller, more modular functions that have clear responsibilities.
Summary of Changes
In GedcomExporter.php:
In GedcomImporter.php:
These changes improve the code structure by breaking down the large handle() functions into smaller, more modular functions. This enhances code readability, maintainability, and testability.