Skip to content

feat: PHP SDK 24.0.1 — nullable BillingLimits, consoleAccessedAt empty default#72

Closed
premtsd-code wants to merge 2 commits into
mainfrom
dev
Closed

feat: PHP SDK 24.0.1 — nullable BillingLimits, consoleAccessedAt empty default#72
premtsd-code wants to merge 2 commits into
mainfrom
dev

Conversation

@premtsd-code
Copy link
Copy Markdown
Contributor

@premtsd-code premtsd-code commented May 20, 2026

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

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 20, 2026

Greptile Summary

This patch (SDK 24.0.1) fixes a runtime crash where every Project response parse failed with InvalidArgumentException: Missing required field "bandwidth" because the server emits billingLimits: {} for plans with no limits crossed. It also rolls back the Presences service that was added in the previous release.

  • BillingLimits / Project: all eight BillingLimits fields are now ?int = null, the required-field guards are removed, and Project.billingLimits is moved to a trailing optional parameter (?BillingLimits = null). The from() hydration now tolerates a sparse or absent billingLimits payload without throwing.
  • Presences rollback: Presences service, Presence/PresenceList models, Prompt enum, presences.read/presences.write scopes, all related docs and tests are removed — no remaining references found in the codebase.
  • Test fixtures: billingLimits sample data removed from all 14 ProjectTest cases to match the new "absent key → null" path.

Confidence Score: 5/5

Safe to merge — targeted fix for a real parse crash and a clean rollback of an unreleased feature, with no remaining broken references.

The billing-limits changes correctly address the parse failure without introducing new required fields or breaking the constructor API. All Presences-related symbols were fully removed with no dangling imports confirmed by codebase-wide search. Test fixtures updated consistently across 14 test cases.

No files require special attention.

Important Files Changed

Filename Overview
src/Appwrite/Models/BillingLimits.php All 8 fields changed from required int to optional ?int = null; required-field guards removed from from()
src/Appwrite/Models/Project.php billingLimits moved to optional trailing constructor parameter; $allowsNull = true has no effect for array payload but fix is functionally correct
src/Appwrite/Enums/Prompt.php Enum deleted; confirmed no remaining imports anywhere in the repo
src/Appwrite/Services/Presences.php Entire Presences service deleted — coherent feature rollback
src/Appwrite/Client.php Version bumped from 24.0.0 → 24.0.1
tests/Appwrite/Services/ProjectTest.php billingLimits fixture removed from all 14 test cases
CHANGELOG.md Version 24.0.1 entry added; PR title says 23.1.1 (mismatch)

Reviews (2): Last reviewed commit: "chore: bump version to 24.0.1 and add ch..." | Re-trigger Greptile

Comment on lines 39 to 42
public static function from(array $data): static
{
if (!array_key_exists('bandwidth', $data)) {
throw new \InvalidArgumentException('Missing required field "bandwidth" for ' . static::class . '.');
}
if (!array_key_exists('storage', $data)) {
throw new \InvalidArgumentException('Missing required field "storage" for ' . static::class . '.');
}
if (!array_key_exists('users', $data)) {
throw new \InvalidArgumentException('Missing required field "users" for ' . static::class . '.');
}
if (!array_key_exists('executions', $data)) {
throw new \InvalidArgumentException('Missing required field "executions" for ' . static::class . '.');
}
if (!array_key_exists('GBHours', $data)) {
throw new \InvalidArgumentException('Missing required field "GBHours" for ' . static::class . '.');
}
if (!array_key_exists('imageTransformations', $data)) {
throw new \InvalidArgumentException('Missing required field "imageTransformations" for ' . static::class . '.');
}
if (!array_key_exists('authPhone', $data)) {
throw new \InvalidArgumentException('Missing required field "authPhone" for ' . static::class . '.');
}
if (!array_key_exists('budgetLimit', $data)) {
throw new \InvalidArgumentException('Missing required field "budgetLimit" for ' . static::class . '.');
}

return new static(
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Stray blank line left after the required-field validation checks were removed. The from() method body now opens with an empty line before return new static(, which is a leftover from the deletion.

Suggested change
public static function from(array $data): static
{
if (!array_key_exists('bandwidth', $data)) {
throw new \InvalidArgumentException('Missing required field "bandwidth" for ' . static::class . '.');
}
if (!array_key_exists('storage', $data)) {
throw new \InvalidArgumentException('Missing required field "storage" for ' . static::class . '.');
}
if (!array_key_exists('users', $data)) {
throw new \InvalidArgumentException('Missing required field "users" for ' . static::class . '.');
}
if (!array_key_exists('executions', $data)) {
throw new \InvalidArgumentException('Missing required field "executions" for ' . static::class . '.');
}
if (!array_key_exists('GBHours', $data)) {
throw new \InvalidArgumentException('Missing required field "GBHours" for ' . static::class . '.');
}
if (!array_key_exists('imageTransformations', $data)) {
throw new \InvalidArgumentException('Missing required field "imageTransformations" for ' . static::class . '.');
}
if (!array_key_exists('authPhone', $data)) {
throw new \InvalidArgumentException('Missing required field "authPhone" for ' . static::class . '.');
}
if (!array_key_exists('budgetLimit', $data)) {
throw new \InvalidArgumentException('Missing required field "budgetLimit" for ' . static::class . '.');
}
return new static(
public static function from(array $data): static
{
return new static(

@premtsd-code premtsd-code changed the title feat: PHP SDK update for version 23.1.1 feat: PHP SDK 24.0.1 — nullable BillingLimits, consoleAccessedAt empty default May 20, 2026
@premtsd-code premtsd-code deleted the dev branch May 20, 2026 06:26
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.

1 participant