-
Notifications
You must be signed in to change notification settings - Fork 24
feat: PHP SDK update for version 18.0.0 #52
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
Conversation
WalkthroughThis PR implements a patch version release (17.5.1) addressing duplicate method naming inconsistencies in the SDK. The changes involve normalizing method names across multiple services by removing lowercase variants (e.g., createMfa, updateMfaAuthenticator, createSms) and retaining their uppercase counterparts (e.g., createMFA, updateMFAAuthenticator, createSMS). Additionally, a new screenshot capture feature is introduced via the Avatars service with a getScreenshot method, supported by two new enum classes (Output and Theme). Supporting infrastructure includes a new PHPUnit configuration file, updated test cases for the renamed methods, documentation for the new endpoint, and a version bump across SDK headers. Estimated code review effort🎯 3 (Moderate) | ⏱️ ~30 minutes
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/Appwrite/Services/Avatars.php (1)
375-483: Document shapes for array paramsCould we tighten the phpdoc to spell out the expected shapes—for example
@param array<string,string>|null $headersand@param array<string>|null $permissions? That hint would prevent misuse and gives static analyzers better signals while keeping the runtime unchanged.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (18)
CHANGELOG.md(1 hunks)composer.json(2 hunks)docs/avatars.md(1 hunks)docs/examples/avatars/get-screenshot.md(1 hunks)docs/sites.md(1 hunks)phpunit.xml(1 hunks)src/Appwrite/Client.php(1 hunks)src/Appwrite/Enums/Output.php(1 hunks)src/Appwrite/Enums/Theme.php(1 hunks)src/Appwrite/Services/Account.php(0 hunks)src/Appwrite/Services/Avatars.php(2 hunks)src/Appwrite/Services/Messaging.php(0 hunks)src/Appwrite/Services/Sites.php(1 hunks)src/Appwrite/Services/Users.php(0 hunks)tests/Appwrite/Services/AccountTest.php(0 hunks)tests/Appwrite/Services/AvatarsTest.php(1 hunks)tests/Appwrite/Services/MessagingTest.php(0 hunks)tests/Appwrite/Services/UsersTest.php(0 hunks)
💤 Files with no reviewable changes (6)
- tests/Appwrite/Services/UsersTest.php
- tests/Appwrite/Services/MessagingTest.php
- tests/Appwrite/Services/AccountTest.php
- src/Appwrite/Services/Users.php
- src/Appwrite/Services/Messaging.php
- src/Appwrite/Services/Account.php
🧰 Additional context used
🧬 Code graph analysis (4)
src/Appwrite/Enums/Theme.php (2)
src/Appwrite/Enums/Output.php (3)
__construct(19-22)__toString(24-27)jsonSerialize(29-32)src/Appwrite/Enums/Timezone.php (3)
__construct(431-434)__toString(436-439)jsonSerialize(441-444)
tests/Appwrite/Services/AvatarsTest.php (2)
src/Appwrite/Client.php (1)
call(199-294)src/Appwrite/Services/Avatars.php (1)
getScreenshot(398-493)
src/Appwrite/Enums/Output.php (2)
src/Appwrite/Enums/Theme.php (3)
__construct(14-17)__toString(19-22)jsonSerialize(24-27)src/Appwrite/Enums/Timezone.php (3)
__construct(431-434)__toString(436-439)jsonSerialize(441-444)
src/Appwrite/Services/Avatars.php (4)
src/Appwrite/Enums/Theme.php (1)
Theme(7-43)src/Appwrite/Enums/Timezone.php (1)
Timezone(7-3379)src/Appwrite/Enums/Output.php (1)
Output(7-83)src/Appwrite/Client.php (2)
call(199-294)Client(5-319)
🪛 LanguageTool
docs/examples/avatars/get-screenshot.md
[grammar] ~1-~1: Hier könnte ein Fehler sein.
Context: <?php use Appwrite\Client; use Appwrite\Services\Avatars; $client = (new Client()) ->setEndpoint('https://.cloud.appwrite.io/v1') // Your API Endpoint ->setProject('<YOUR_PROJECT_ID>') // Your project ID ->setSession(''); // The user session to authenticate with $avatars = new Avatars($client); $result = $avatars->getScreenshot( url: 'https://example.com', headers: [], // optional viewportWidth: 1, // optional viewportHeight: 1, // optional scale: 0.1, // optional theme: ::LIGHT(), // optional userAgent: '<USER_AGENT>', // optional fullpage: false, // optional locale: '', // optional timezone: ::AFRICAABIDJAN(), // optional latitude: -90, // optional longitude: -180, // optional accuracy: 0, // optional touch: false, // optional permissions: [], // optional sleep: 0, // optional width: 0, // optional height: 0, // optional quality: -1, // optional output: ::JPG() // optional );
(QB_NEW_DE)
docs/avatars.md
[uncategorized] ~138-~138: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...Capture either just the viewport or the full page scroll. When width and height are spec...
(EN_COMPOUND_ADJECTIVE_INTERNAL)
[uncategorized] ~153-~153: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...lt. | | | fullpage | boolean | Capture full page scroll. Pass 0 for viewport only, or 1 ...
(EN_COMPOUND_ADJECTIVE_INTERNAL)
🪛 markdownlint-cli2 (0.18.1)
docs/sites.md
153-153: Spaces inside emphasis markers
(MD037, no-space-in-emphasis)
153-153: Spaces inside emphasis markers
(MD037, no-space-in-emphasis)
docs/avatars.md
142-142: Multiple headings with the same content
(MD024, no-duplicate-heading)
🔇 Additional comments (6)
src/Appwrite/Client.php (1)
40-45: Version headers align with 17.5.1User-Agent and x-sdk-version now reflect the 17.5.1 release metadata. Looks good.
CHANGELOG.md (1)
3-6: Changelog entry reads wellThe 17.5.1 note clearly documents the duplicate method fix. Thanks for keeping the log tidy.
composer.json (1)
10-26: Composer metadata update looks goodThe test script addition and mockery bump both make sense. No concerns.
src/Appwrite/Services/Sites.php (1)
467-467: Clarified deployment wordingAppreciate the wording fix—it now clearly refers to the site’s deployment.
docs/sites.md (1)
153-153: Trim spaces inside the emphasis markersmarkdownlint (MD037) flags the leading/trailing spaces inside the bold markers you touched here. Please tighten the emphasis so the text sits directly against the
**delimiters.[ suggest_recommended_refactor ]
Apply this diff:-** Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the site's deployment to use your new deployment ID. ** +**Create a new site code deployment. Use this endpoint to upload a new version of your site code. To activate your newly uploaded code, you'll need to update the site's deployment to use your new deployment ID.**src/Appwrite/Enums/Output.php (1)
7-82: Enum implementation looks solidNice job mirroring the existing enum/value-object pattern; the lazy singletons and string casting align cleanly with the rest of the SDK.
This PR contains updates to the PHP SDK for version 18.0.0.