fix: rebase PR #99 - SMSGateApp SMS adapter - #140
Conversation
Original by @capcom6. Fixed: - Added parent::__construct() call - Made properties private readonly - Moved apiEndpoint default to constructor parameter default - Aligned with v2.0.0 conventions
|
Thanks for contributing! This repository is a read-only mirror; development for this library happens in |
Greptile SummaryAdds an SMSGateApp SMS adapter and its credential-gated integration test.
Confidence Score: 4/5The endpoint handling in the integration test needs to be fixed before merging because the normal default-endpoint configuration throws a TypeError. When credentials are configured without an endpoint override, the test converts the missing value to null and explicitly supplies it to a constructor parameter that only accepts strings. tests/Messaging/Adapter/SMS/SMSGateAppTest.php Important Files Changed
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
tests/Messaging/Adapter/SMS/SMSGateAppTest.php:21-23
**Null endpoint bypasses default**
When the credentials and recipient are configured but `SMSGATEAPP_ENDPOINT` is unset, the test explicitly passes `null` to the non-nullable `string` constructor parameter, causing a `TypeError` instead of using `DEFAULT_API_ENDPOINT` and sending the SMS.
Reviews (1): Last reviewed commit: "fix: rebase PR #99 - SMSGateApp SMS adap..." | Re-trigger Greptile |
| $endpoint = \getenv('SMSGATEAPP_ENDPOINT') ?: null; | ||
|
|
||
| $sender = new SMSGateApp($username, $password, $endpoint); |
There was a problem hiding this comment.
Null endpoint bypasses default
When the credentials and recipient are configured but SMSGATEAPP_ENDPOINT is unset, the test explicitly passes null to the non-nullable string constructor parameter, causing a TypeError instead of using DEFAULT_API_ENDPOINT and sending the SMS.
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/Messaging/Adapter/SMS/SMSGateAppTest.php
Line: 21-23
Comment:
**Null endpoint bypasses default**
When the credentials and recipient are configured but `SMSGATEAPP_ENDPOINT` is unset, the test explicitly passes `null` to the non-nullable `string` constructor parameter, causing a `TypeError` instead of using `DEFAULT_API_ENDPOINT` and sending the SMS.
How can I resolve this? If you propose a fix, please make it concise.
Replacement for #99. Original by @capcom6.
Rebased on latest main. Fixed: