Skip to content

feat: PHP SDK update for version 24.0.0#71

Merged
abnegate merged 3 commits into
mainfrom
dev
May 19, 2026
Merged

feat: PHP SDK update for version 24.0.0#71
abnegate merged 3 commits into
mainfrom
dev

Conversation

@ArnabChatterjee20k
Copy link
Copy Markdown
Member

@ArnabChatterjee20k ArnabChatterjee20k commented May 18, 2026

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

What's Changed

  • Breaking: Renamed AuthMethod enum to ProjectAuthMethodId
  • Breaking: Renamed EmailTemplateType to ProjectEmailTemplateId and EmailTemplateLocale to ProjectEmailTemplateLocale
  • Breaking: Renamed ServiceId to ProjectServiceId, ProtocolId to ProjectProtocolId, Secure to ProjectSMTPSecure, ProjectPolicy to ProjectPolicyId
  • Breaking: Replaced Scopes enum with ProjectKeyScopes for project key endpoints
  • Breaking: Removed updateDenyCanonicalEmailPolicy; replaced with updateDenyAliasedEmailPolicy, updateDenyDisposableEmailPolicy, and updateDenyFreeEmailPolicy
  • Breaking: Removed AuthProvider model; use new ProjectOAuthProviderId enum instead
  • Added: Project::get method to fetch current project details
  • Added: Advisor, Presences, and Usage services
  • Added: Insight, Presence, Report, UsageEvent, and UsageGauge models with list variants
  • Added: ProjectAuthMethod, ProjectProtocol, and ProjectService models
  • Added: ProjectOAuthProviderId and ProjectOAuth2GooglePrompt enums
  • Updated: Project, Database, and OAuth2Google model schemas
  • Updated: X-Appwrite-Response-Format header to 1.9.5

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 18, 2026

Greptile Summary

This PR updates the PHP SDK to version 24.0.0, introducing three new services (Advisor, Presences, Usage), several new models (Insight, Presence, Report, UsageEvent, UsageGauge and their list variants), and a sweeping rename of existing enums to adopt the Project* naming convention.

  • Breaking renames: AuthMethodProjectAuthMethodId, EmailTemplateTypeProjectEmailTemplateId, EmailTemplateLocaleProjectEmailTemplateLocale, ServiceIdProjectServiceId, ProtocolIdProjectProtocolId, SecureProjectSMTPSecure, ProjectPolicyProjectPolicyId; AuthProvider model is removed and replaced by ProjectOAuthProviderId enum.
  • New additions: Project::get, Advisor, Presences, and Usage services are fully implemented following established SDK patterns; new enums ProjectOAuth2GooglePrompt, ProjectKeyScopes, and ProjectOAuthProviderId are added.
  • Scope enum duplication: Scopes.php was updated in this PR with the same seven new scope values that were also added to the new ProjectKeyScopes.php, leaving both files as identical mirrors with no clear boundary between them.

Confidence Score: 5/5

This PR is safe to merge; changes are largely mechanical renames generated from the SDK spec and the new service implementations follow the established SDK patterns correctly.

All three new services and their models are implemented consistently with the rest of the codebase. The breaking renames are intentional and clearly documented. The only concern is the parallel maintenance of Scopes.php and ProjectKeyScopes.php with identical values, which creates consumer confusion but does not break any runtime behavior.

src/Appwrite/Enums/Scopes.php and src/Appwrite/Enums/ProjectKeyScopes.php — both were updated with the same new scope values, leaving their purpose ambiguous.

Important Files Changed

Filename Overview
src/Appwrite/Services/Project.php Updated with new methods (get, updateDenyAliasedEmailPolicy, updateDenyDisposableEmailPolicy, updateDenyFreeEmailPolicy) and renamed enum parameters; unused imports for ProjectKeyScopes and ProjectOAuth2GooglePrompt (flagged in previous threads)
src/Appwrite/Enums/Scopes.php Updated with 7 new scope values that are identical to what was added to ProjectKeyScopes, creating two parallel enums with the same content and no clear ownership boundary
src/Appwrite/Enums/ProjectKeyScopes.php New enum intended to replace Scopes for project key endpoints; mirrors Scopes.php exactly but is imported and unused in service methods where $scopes is typed as plain array
src/Appwrite/Services/Advisor.php New Advisor service with listReports, getReport, deleteReport, listInsights, getInsight — follows established SDK patterns correctly
src/Appwrite/Services/Presences.php New Presences service with list, get, upsert, updatePresence, delete — consistently follows SDK patterns
src/Appwrite/Services/Usage.php New Usage service with listEvents and listGauges — straightforward and correct
src/Appwrite/Models/Insight.php New Insight model with correct hydration of nested InsightCTA list and proper optional field handling
src/Appwrite/Models/Presence.php New Presence model using ADDITIONAL_PROPERTIES for metadata capture; required/optional field handling is correct
src/Appwrite/Client.php Updated SDK version to 24.0.0 and X-Appwrite-Response-Format header to 1.9.5
src/Appwrite/Enums/ProjectOAuthProviderId.php New enum replacing the AuthProvider model; includes githubImagine and googleImagine providers that were intentionally removed from OAuthProvider in this same PR

Reviews (2): Last reviewed commit: "Merge branch 'main' into dev" | Re-trigger Greptile


namespace Appwrite\Models;

use Appwrite\Enums\OAuth2GooglePrompt;
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 Inconsistent enum: OAuth2GooglePrompt vs ProjectOAuth2GooglePrompt

This PR introduces two newly-created, functionally identical enums — OAuth2GooglePrompt and ProjectOAuth2GooglePrompt — both containing the same three values (none, consent, select_account). The model hydrates prompt using OAuth2GooglePrompt, while Project.php imports ProjectOAuth2GooglePrompt. Given that all other enums in this PR adopt the Project* naming convention, the model should reference ProjectOAuth2GooglePrompt (and OAuth2GooglePrompt should be removed), or vice-versa. As-is, consumers see two interchangeable but distinct types for the same concept.

Comment on lines +11 to +12
use Appwrite\Enums\ProjectOAuth2GooglePrompt;
use Appwrite\Enums\ProjectOAuthProviderId;
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 Unused import ProjectOAuth2GooglePrompt

ProjectOAuth2GooglePrompt is imported here, but updateOAuth2Google types the $prompt parameter as ?array — the import is never referenced as a type hint and will be flagged by static analysis tools.

Suggested change
use Appwrite\Enums\ProjectOAuth2GooglePrompt;
use Appwrite\Enums\ProjectOAuthProviderId;
use Appwrite\Enums\ProjectOAuthProviderId;

Comment on lines +9 to +10
use Appwrite\Enums\ProjectAuthMethodId;
use Appwrite\Enums\ProjectKeyScopes;
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 Unused import ProjectKeyScopes

ProjectKeyScopes is imported but createKey, createEphemeralKey, and updateKey all type their $scopes parameter as plain array, so this import is never used as a type hint.

Suggested change
use Appwrite\Enums\ProjectAuthMethodId;
use Appwrite\Enums\ProjectKeyScopes;
use Appwrite\Enums\ProjectAuthMethodId;

# Conflicts:
#	CHANGELOG.md
#	docs/examples/project/update-o-auth-2-google.md
#	docs/project.md
#	src/Appwrite/Client.php
#	src/Appwrite/Services/Project.php
#	tests/Appwrite/Services/ProjectTest.php
@abnegate abnegate merged commit d614c93 into main May 19, 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