Update CI actions to Node 24 runtime - #1
Closed
Gasol wants to merge 15 commits into
Closed
Conversation
Research-backed PSR-style specification for an interoperable, PHP 5.4-safe SMS gateway interface (core SmsClientInterface + segregated capability interfaces), synthesized from a survey of ~49 providers and standards. Includes the Mitake API v2.14 doc used as the worked reference mapping.
Resolve the issues flagged by the completeness review: - Deterministic status normalization (Mitake code 0->SCHEDULED, 8->EXPIRED) - getRemainingBalance() returns Balance, not Money - Add PointsCost value object + getPointsCost() for non-currency billing - Add retryable RateLimitExceededException; remap Mitake 'l' / HTTP 429 - Specify bulk partial-failure semantics + SmsResult::isSuccessful() - Add InboundMessageInterface::getMediaUrls() for inbound MMS - Collapse duplicate CHANNEL_SILENT_AUTH; add rcs recipient kind - Fix GSM-7 extension set (include euro); namespace the Gsm7 helper
Convert the spec from PHP 5.4-clean to modern PHP 8.1+: - Native parameter type hints and return types on every signature - Constant holders -> string-backed enums (DeliveryState, Encoding, MessageType, VerificationChannelType, RecipientKind) - Value objects use readonly promoted properties; with*() rebuild via new self(); \DateTimeInterface instead of \DateTime - SmsExceptionInterface now extends \Throwable (PSR-18 style) - Target Runtime updated to PHP 8.1+ All 55 PHP blocks pass php -l on PHP 8.5.
Replace the CAP_* class constants on CapabilityAwareInterface with a string-backed Capability enum; retype supports(Capability $capability): bool and convert all 27 references doc-wide. All 55 PHP blocks pass php -l.
Composer package codepower/sms-mitake (PSR-4 CodePower\Mitake\, PHP >=8.1, ext-curl). Charset enum (UTF8/Big5 with mbstring-backed conversion), immutable Credentials value object, and the exception hierarchy rooted at MitakeExceptionInterface.
HttpClient interface + immutable HttpResponse, and a default cURL implementation (CurlHttpClient) enforcing TLS 1.2+, with configurable timeouts and support for both form-encoded and raw bodies.
Message (outbound SmSend/SmBulkSend fields), StatusCode (numeric delivery codes + letter error codes with Taiwan-Chinese descriptions), and the result objects SendResult, StatusResult, CancelResult, Balance.
ResponseParser turns Mitake's plain-text formats (bracketed send blocks, tab-separated status rows, AccountPoint balance, msgid=code cancel lines) into result objects, raising ResponseException on error codes. DeliveryReceipt parses the status callback and builds the required acknowledgement body.
Ties the layers together: send (SmSend), sendBulk (SmBulkSend, up to 500, $$-delimited records), queryStatus + queryBalance (SmQuery), and cancel (SmCancel). Handles charset encoding (UTF8/Big5), newline->ASCII-0x06, per-endpoint query/form/raw-body shapes, and input-limit validation.
40 tests (116 assertions) covering StatusCode classification, Charset encoding, Message validation, ResponseParser (send/status/balance/cancel + error tokens), DeliveryReceipt parsing/ack, and the Client's request shaping and response parsing via a fake HTTP transport. All green on PHP 8.5.
Rewrite the README with real usage (send, bulk, status/balance, cancel, callback) and bump the stated requirement to PHP >=8.1 + ext-curl. Add a 'composer test' script.
The vendor-neutral interface spec lives in its own repo (codepower/sms-psr); this package is a standalone Mitake client and no longer needs it.
Run the test suite on push and pull requests across PHP 8.1-8.4 (setup-php with curl + mbstring, composer validate, composer test).
Bump actions/checkout v4 -> v5 (Node 24) and replace ramsey/composer-install (which pulls in the Node 20 actions/cache) with a direct composer install, silencing the Node.js 20 deprecation warnings.
This file contains hidden or 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
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.
Fixes the "Node.js 20 actions are deprecated" warnings from run 26731397920.
The annotation named two offenders:
actions/checkout@v4(Node 20) → bumped to@v5(Node 24).actions/cache@…(Node 20), pulled in internally byramsey/composer-install@v3→ removed the action in favour of a directcomposer installstep (dependency caching isn't worth keeping a flagged action for a small library).shivammathur/setup-php@v2was not flagged and already runs on Node 24.Tests still pass locally (40 tests, 116 assertions) on PHP 8.5; CI on this PR exercises PHP 8.1–8.4.