Skip to content

feat: PHP SDK update for version 24.1.0#73

Merged
premtsd-code merged 5 commits into
mainfrom
dev
May 20, 2026
Merged

feat: PHP SDK update for version 24.1.0#73
premtsd-code merged 5 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.1.0.

Changes

  • Added sizeActual property to File model for actual stored size after compression/encryption
  • Updated BillingLimits properties to be nullable to match the server's sparse "limits crossed" response
  • Updated Project.billingLimits to be nullable
  • Updated advisor example docs to use API key authentication
  • Removed orphaned Prompt enum (already unused; superseded by ProjectOAuth2GooglePrompt in 24.0.0)

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 20, 2026

Greptile Summary

This PR bumps the PHP SDK to version 24.1.0 with three functional changes: BillingLimits fields are now all nullable to match the server's sparse response, File gains a required sizeActual field, and the orphaned Prompt enum is deleted.

  • BillingLimits and Project.billingLimits made fully nullable — all required-field guards replaced with null-safe array_key_exists lookups, and Project::from() uses hydrateTypedValue with allowsNull=true.
  • File model extended with a required sizeActual: int field (actual stored size after compression/encryption); all four Storage test fixtures updated accordingly.
  • Advisor example docs corrected from session-based to API key auth; orphaned Prompt enum (no remaining references in source or tests) and the deleted updateDenyCanonicalEmailPolicy example doc removed cleanly.

Confidence Score: 5/5

All changes are additive or narrowly scoped model updates with consistent validation, serialization, and test fixture coverage.

The nullable BillingLimits refactor correctly handles both absent and present keys via array_key_exists guards and the existing hydrateTypedValue null-passthrough logic. The new sizeActual field on File is required and consistently plumbed through construction, validation, and serialization. The Prompt enum deletion was verified against the full source tree — zero remaining references. No logic errors or contract breaks were found across any of the changed files.

No files require special attention.

Important Files Changed

Filename Overview
src/Appwrite/Models/BillingLimits.php All eight fields made nullable with null defaults; required-field validation blocks removed in favor of null-safe array_key_exists lookups to match the server's sparse "limits crossed" response
src/Appwrite/Models/Project.php billingLimits moved to an optional nullable parameter (last position); from() uses array_key_exists guard and passes allowsNull=true to hydrateTypedValue, correctly handling absent/null server responses
src/Appwrite/Models/File.php Added required non-nullable sizeActual int field between sizeOriginal and chunksTotal; validation, construction, and serialization all updated consistently
src/Appwrite/Enums/Prompt.php Deleted; confirmed no remaining references in source or tests — superseded by ProjectOAuth2GooglePrompt in 24.0.0
src/Appwrite/Client.php Version bump in user-agent and x-sdk-version headers from 24.0.0 to 24.1.0
tests/Appwrite/Services/ProjectTest.php Removed billingLimits block from all 14 test fixtures to reflect the field being optional; no assertions exist for billingLimits so test coverage for the now-null case is absent but not a regression
tests/Appwrite/Services/StorageTest.php Added sizeActual to all four File mock response fixtures to match the new required field
docs/examples/advisor/get-insight.md Corrected auth method from setSession('') to setKey('<YOUR_API_KEY>') across all four Advisor example docs — Advisor is a server-side API requiring key auth

Reviews (5): Last reviewed commit: "chore: update PHP SDK to 24.1.0" | 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 There is a stray blank line immediately after the opening brace of from(), left over from removing the required-field validation blocks. It has no functional impact but looks unintentional.

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(

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@premtsd-code premtsd-code changed the title feat: PHP SDK update for version 24.0.0 feat: PHP SDK 24.0.1 — nullable BillingLimits, File.sizeActual, consoleAccessedAt empty default May 20, 2026
@premtsd-code premtsd-code changed the title feat: PHP SDK 24.0.1 — nullable BillingLimits, File.sizeActual, consoleAccessedAt empty default feat: PHP SDK update for version 24.0.1 May 20, 2026
* Breaking: Removed `Prompt` enum class
* Breaking: Changed `BillingLimits` properties from required to nullable
* Breaking: Moved `billingLimits` property to optional in `Project` model
* Added `sizeActual` property to `File` model for compressed storage size
* Updated authentication examples from session to API key based
* Breaking: Removed `updateDenyCanonicalEmailPolicy` method documentation
@premtsd-code premtsd-code changed the title feat: PHP SDK update for version 24.0.1 feat: PHP SDK update for version 25.0.0 May 20, 2026
@premtsd-code premtsd-code changed the title feat: PHP SDK update for version 25.0.0 feat: PHP SDK update for version 24.1.0 May 20, 2026
Copy link
Copy Markdown
Member

@ChiragAgg5k ChiragAgg5k left a comment

Choose a reason for hiding this comment

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

LGTM. Auto-generated SDK updates consistent with the matching PRs in the other language SDKs (sizeActual on File, BillingLimits nullability, advisor docs switched to API key auth, version + changelog bump).

@premtsd-code premtsd-code merged commit dcb3550 into main May 20, 2026
1 check passed
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.

2 participants