Restructure project into a proper PHP package with autoloading, separation of concerns, and unit tests #2

Open
opened 2026-04-04 13:45:29 +01:00 by mon · 0 comments
Owner

The current project consists of two standalone PHP files placed in a single folder.

While functional, the structure makes the code harder to maintain, test, and extend.

This issue proposes reorganizing the project into a proper PHP package with clear separation of concerns, autoloading, and automated tests.

Goals

  • Introduce a clean, conventional project structure
  • Separate CLI logic, API client logic, configuration handling, and logging
  • Add Composer for autoloading and dependency management
  • Make the Porkbun API wrapper testable
  • Add PHPUnit tests for core functionality
  • Prepare the project for future enhancements (retry logic, better error handling, etc.)

Proposed Tasks

  • Create a standard PHP project layout
  • Refactor existing code into classes
  • Introduce Composer
  • Add unit tests
  • Improve error handling
  • Update README.md

Expected Outcome

A maintainable, testable, and extensible PHP project that follows modern best practices. The codebase becomes easier to reason about, safer to modify, and ready for future features such as retries, logging improvements, or additional Porkbun API endpoints.

The current project consists of two standalone PHP files placed in a single folder. While functional, the structure makes the code harder to maintain, test, and extend. This issue proposes reorganizing the project into a proper PHP package with clear separation of concerns, autoloading, and automated tests. **Goals** - Introduce a clean, conventional project structure - Separate CLI logic, API client logic, configuration handling, and logging - Add Composer for autoloading and dependency management - Make the Porkbun API wrapper testable - Add PHPUnit tests for core functionality - Prepare the project for future enhancements (retry logic, better error handling, etc.) **Proposed Tasks** - [ ] Create a standard PHP project layout - [ ] Refactor existing code into classes - [ ] Introduce Composer - [ ] Add unit tests - [ ] Improve error handling - [ ] Update README.md **Expected Outcome** A maintainable, testable, and extensible PHP project that follows modern best practices. The codebase becomes easier to reason about, safer to modify, and ready for future features such as retries, logging improvements, or additional Porkbun API endpoints.
mon self-assigned this 2026-04-04 13:45:39 +01:00
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mon/pb-dydns#2
No description provided.