Refactored DocumentationGenerator.php for tests