Skip to content

Commit a7eb17f

Browse files
Update CLAUDE.md to reflect SDK enhancements and testing instructions
- Updated project overview to include new features in SOLAPI PHP SDK version 5.1.0, including PSR-18 HTTP client requirements. - Added detailed testing commands for unit, end-to-end, and coverage tests. - Revised architecture section to reflect changes in the HTTP client implementation. - Enhanced documentation on E2E test environment variables and SSL verification settings.
1 parent 2a600e9 commit a7eb17f

1 file changed

Lines changed: 34 additions & 6 deletions

File tree

CLAUDE.md

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,40 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
44

55
## Project Overview
66

7-
SOLAPI PHP SDK - A zero-dependency messaging SDK for Korean telecommunications (SMS, LMS, MMS, Kakao Alimtalk, Voice, Fax). Version 5.0.6, requires PHP 7.1+ with curl and json extensions.
7+
SOLAPI PHP SDK - A messaging SDK for Korean telecommunications (SMS, LMS, MMS, Kakao Alimtalk, Kakao BMS, Voice, Fax). Version 5.1.0, requires PHP 7.1+ with json extension and `allow_url_fopen` enabled (or a custom PSR-18 HTTP client).
8+
9+
**Dependencies:** PSR HTTP interfaces (psr/http-client, psr/http-message) + nyholm/psr7
810

911
## Commands
1012

1113
```bash
12-
# Install dependencies (none required, autoloader only)
14+
# Install dependencies
1315
composer install
1416

15-
# There are no local tests - see https://github.com/solapi/solapi-php-examples for usage examples
17+
# Run all tests
18+
composer test
19+
20+
# Unit tests only (no API calls required)
21+
composer test:unit
22+
23+
# E2E tests (requires environment variables - see below)
24+
composer test:e2e
25+
26+
# Run with coverage report
27+
composer test:coverage
28+
29+
# Run a single test
30+
./vendor/bin/phpunit --filter testName
31+
```
32+
33+
### E2E Test Environment Variables
34+
35+
```bash
36+
SOLAPI_API_KEY=xxx
37+
SOLAPI_API_SECRET=xxx
38+
SOLAPI_KAKAO_PF_ID=xxx
39+
SOLAPI_SENDER_NUMBER=01012345678
40+
SOLAPI_RECIPIENT_NUMBER=01087654321
1641
```
1742

1843
## Architecture
@@ -21,19 +46,21 @@ composer install
2146

2247
**Call Flow:**
2348
```
24-
SolapiMessageService → Fetcher (singleton) → Authenticator (static) → CURL → api.solapi.com
49+
SolapiMessageService → Fetcher (singleton) → Authenticator (static) → HttpClient (stream_context) → api.solapi.com
2550
```
2651

2752
**Key Classes:**
2853
- `SolapiMessageService` - Primary API: send(), uploadFile(), getMessages(), getGroups(), getBalance()
2954
- `Message` (`Models/Message.php`) - Fluent builder for message construction
30-
- `Fetcher` (`Libraries/Fetcher.php`) - Singleton HTTP client
55+
- `Fetcher` (`Libraries/Fetcher.php`) - Singleton HTTP client orchestrator
56+
- `HttpClient` (`Libraries/HttpClient.php`) - PSR-18 implementation using `stream_context` + `file_get_contents`
3157
- `Authenticator` (`Libraries/Authenticator.php`) - HMAC-SHA256 auth header generation
3258

3359
**Models Structure:**
3460
- `Models/Request/` - 7 request DTOs (SendRequest, GetMessagesRequest, etc.)
3561
- `Models/Response/` - 17 response DTOs (SendResponse, GroupMessageResponse, etc.)
3662
- `Models/Kakao/` - Kakao message options (pfId, templateId, buttons)
63+
- `Models/Kakao/Bms/` - Kakao Brand Message Service (14 files, 8 chatBubbleTypes) - see `src/Models/Kakao/Bms/AGENTS.md`
3764
- `Models/Voice/` - Voice message options
3865
- `Models/Fax/` - Fax message options
3966

@@ -78,7 +105,8 @@ Follow Kent Beck's "Tidy First" principles when making code changes:
78105
- **Singleton State:** Fetcher singleton retains credentials - don't mix different API keys in the same process
79106
- **Null Returns:** Many get* methods return `null` on any exception instead of throwing - always check response validity
80107
- **No Interfaces:** Service/Fetcher lack contracts - mocking requires concrete class extension
81-
- **SSL Verification:** Disabled in Fetcher (`CURLOPT_SSL_VERIFYPEER = false`)
108+
- **PSR-18 HTTP Client:** Default HttpClient uses `stream_context` + `file_get_contents`. A custom PSR-18 client can be injected if needed (e.g., for cURL or Guzzle)
109+
- **SSL Verification:** Enabled by default in HttpClient; can be disabled via constructor options
82110

83111
## External Resources
84112

0 commit comments

Comments
 (0)