-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V2: Major Enhancements and Refactoring #10
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…tecture This commit significantly refactors the Termii PHP library by removing outdated files and dependencies. It introduces new resource structures, including MessagingResource, SenderIdResource, and CampaignResource, for improved organization and functionality. The Termii class has been updated to integrate these resources, offering a more modular and maintainable architecture for interacting with Termii's API. Signed-off-by: Douglas Okolaa <[email protected]>
The requests from various parts of the application have been consolidated and refactored into endpoint classes for greater clarity and organization. This change improves maintainability by centralizing request logic, aligning with a more streamlined architecture. Existing requests have been removed or replaced with their endpoint equivalents to ensure consistency across the codebase. Signed-off-by: Douglas Okolaa <[email protected]>
The Termii class now uses a singleton pattern for TermiiConnector initialization, simplifying resource management and avoiding redundant connections. In CampaignResource, the phoneBook method is optimized by implementing lazy initialization for PhonebookResource, ensuring efficient resource use. Signed-off-by: Douglas Okolaa <[email protected]>
Corrected return types in factory methods to match class names, replaced a dangling static instance with direct instantiation, and removed a debug statement. Additionally, a phpstan configuration file was added to enhance code quality checks, and the phpstan dependency was included in composer.json. These changes aim to improve code reliability and maintainability.
…coverage Modified endpoints in Campaign and adjusted class properties for flexibility. The changes improve data handling, such as making certain fields optional, adding new multipart data structure, and refining API key handling in requests. Updated endpoint paths as part of a broader API alignment effort.
Introduced the `ConvertsDtoToRequestArray` interface and implemented it across relevant DTO classes for enhanced request array conversion. This improves data handling consistency and streamlines request building processes.
Enhanced the README with updated code examples for message sending, campaigns, phonebook, and contact management. Improved clarity by restructuring snippets for better usability and understanding. These changes align with the current TermiiPHP SDK functionality.
Added support for generating, sending, and verifying OTPs via voice call, email, in-app, and SMS channels. Introduced relevant resources, endpoints, and tests to ensure functionality and improve API integration. This update enhances the library's utility for handling OTP workflows.
Enhanced the README with updated code examples for message sending, campaigns, phonebook, and contact management. Improved clarity by restructuring snippets for better usability and understanding. These changes align with the current TermiiPHP SDK functionality.
Added `.php-cs-fixer.php` configuration to enforce a consistent code style across the project. Aligned indentation, spacing, and method declaration formatting using PHP-CS-Fixer rules. BREAKING CHANGE: Codebase formatting changes can result in merge conflicts or affect existing pull requests.
Introduced Insight API endpoints including balance retrieval, phone number status, DND check, and message history. Added corresponding test cases, fixtures, and updated resources for seamless integration.
Introduce a new custom `RequestException` to replace Saloon's base exceptions. This ensures consistent exception handling across the codebase and improves modularity by centralizing exception management.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request merges the
v2
branch intodevelop
, incorporating a series of significant updates, performance improvements, and codebase enhancements. These changes align with the longer-term goal of creating a robust, modular, and maintainable SDK, ensuring seamless integration with Termii's API.Highlights of Changes in
v2
1. New Features
Insight API Support
Added new endpoints for the Insight API, including:
Accompanied by corresponding tests and resources for smoother usage.
Token API for OTP Workflows
Implemented endpoints for generating, sending, and verifying OTPs across multiple channels including:
Enhanced with test cases and documentation updates.
Custom
RequestException
ClassIntroduced a new
TermiiRequestException
to replace Saloon's base exceptions. This improves exception handling by centralizing and streamlining error management.Troubleshooting Support
Added initial debugging and troubleshooting capabilities to help developers resolve integration issues quickly.
2. Codebase Refactoring and Optimization
Termii
class to follow the Singleton Pattern for managingTermiiConnector
initialization, reducing redundancy and improving resource handling.ConvertsDtoToRequestArray
interface, implemented across relevant DTOs for consistency in request array conversion.3. Coding Standards and Quality
4. Testing Improvements
CampaignApiTest
.ci(tests)
), ensuring better CI/CD coverage.5. Documentation Updates
Messaging
,Campaigns
,Phonebook
,Contact Management
, etc.).Breaking Changes
Benefits of the Merge
Checklist
Additional Notes
develop
branch after merging.