Skip to content

Conversation

@ChiragAgg5k
Copy link
Member

@ChiragAgg5k ChiragAgg5k commented Nov 10, 2025

This PR contains updates to the PHP SDK for version 18.0.0.

@coderabbitai
Copy link

coderabbitai bot commented Nov 10, 2025

Walkthrough

This 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

  • src/Appwrite/Services/Account.php: Verify correct removal of 9 lowercase MFA methods and replacement with uppercase variants; confirm no logic changes beyond naming
  • src/Appwrite/Services/Messaging.php: Validate removal of 8 deprecated lowercase methods (createSms, updateSms, createApnsProvider, etc.) and confirm new uppercase equivalents remain functional
  • src/Appwrite/Services/Users.php: Check that 6 deprecated MFA methods are properly removed and uppercase replacements are in place
  • src/Appwrite/Services/Avatars.php: Review new getScreenshot method signature, parameter handling, and integration of Theme, Timezone, and Output enums
  • src/Appwrite/Enums/Output.php and Theme.php: Validate enum singleton pattern implementation, JsonSerializable compliance, and lazy initialization
  • Test files (Account, Messaging, Users, Avatars): Confirm test method names align with renamed public methods and coverage remains complete
  • Version consistency: Verify version bump from 17.5.0 to 17.5.1 is applied consistently in Client.php, CHANGELOG.md, and composer.json

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.53% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ⚠️ Warning The PR title claims version 18.0.0, but the actual changes document version 17.5.1 and contain breaking API changes (deprecated method removals) that typically warrant major version bumps, not minor patch versions. Update the title to either 'feat: PHP SDK update for version 17.5.1' to match the changelog, or verify if this should be version 18.0.0 with corresponding documentation updates.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ChiragAgg5k ChiragAgg5k changed the title feat: PHP SDK update for version 17.5.1 feat: PHP SDK update for version 17.6.0 Nov 10, 2025
Copy link

@coderabbitai coderabbitai bot left a 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 params

Could we tighten the phpdoc to spell out the expected shapes—for example @param array<string,string>|null $headers and @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

📥 Commits

Reviewing files that changed from the base of the PR and between e0ea4ae and ace022a.

📒 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.1

User-Agent and x-sdk-version now reflect the 17.5.1 release metadata. Looks good.

CHANGELOG.md (1)

3-6: Changelog entry reads well

The 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 good

The test script addition and mockery bump both make sense. No concerns.

src/Appwrite/Services/Sites.php (1)

467-467: Clarified deployment wording

Appreciate the wording fix—it now clearly refers to the site’s deployment.

docs/sites.md (1)

153-153: Trim spaces inside the emphasis markers

markdownlint (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 solid

Nice job mirroring the existing enum/value-object pattern; the lazy singletons and string casting align cleanly with the rest of the SDK.

@ChiragAgg5k ChiragAgg5k changed the title feat: PHP SDK update for version 17.6.0 feat: PHP SDK update for version 18.0.0 Nov 10, 2025
@abnegate abnegate merged commit 8f7bad9 into main Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants