8000 Fix Safe namespace deprecation warnings by ChiragAgg5k · Pull Request #11227 · appwrite/appwrite · GitHub
[go: up one dir, main page]

Skip to content

Fix Safe namespace deprecation w 8000 arnings#11227

Merged
ChiragAgg5k merged 1 commit into1.8.xfrom
fix-deprecation-warnings
Feb 3, 2026
Merged

Fix Safe namespace deprecation warnings#11227
ChiragAgg5k merged 1 commit into1.8.xfrom
fix-deprecation-warnings

Conversation

@ChiragAgg5k
Copy link
Member

Summary

  • updated Appwrite to address as many Safe namespace deprecation warnings as possible from the docker compose exec appwrite sdks output
  • ensured nullable parameter typing now aligns with PHP 8.3 deprecation guidance for Safe helper wrappers

Testing

  • Not run (not requested)

@coderabbitai
Copy link
Contributor
coderabbitai bot commented Feb 3, 2026
📝 Walkthrough

Walkthrough

This PR makes widespread signature updates to add explicit nullable type hints (e.g., ?string, ?int, ?callable, ?Throwable) across multiple PHP classes and methods. It also reorders and inserts a new array $platform parameter into redeployVcsSite, and introduces a global $register wired into CLI resources via CLI::setResource('register', fn () => $register);. Changes touch constructors and numerous public/protected/private method declarations across auth, messaging, migration, platform, database, workers, and utility modules.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main objective of the changeset: adding nullable type hints to method parameters to address PHP 8.3 Safe namespace deprecation warnings.
Description check ✅ Passed The description is directly related to the changeset, explaining the purpose of the changes (addressing Safe namespace deprecation warnings) and the approach (adding nullable parameter typing).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 fix-deprecation-warnings

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 base branch from main to 1.8.x February 3, 2026 04:20
@pkg-pr-new
Copy link
pkg-pr-new bot commented Feb 3, 2026

Open in StackBlitz

npm i https://pkg.pr.new/appwrite/appwrite/@appwrite.io/console@11227

commit: a2a5d22

@github-actions
Copy link
github-actions bot commented Feb 3, 2026

Security Scan Results for PR

Docker Image Scan Results

Package Version Vulnerability Severity
libcrypto3 3.5.4-r0 CVE-2025-15467 CRITICAL
libcrypto3 3.5.4-r0 CVE-2025-69419 HIGH
libpng 1.6.51-r0 CVE-2025-66293 HIGH
libpng 1.6.51-r0 CVE-2026-22695 HIGH
libpng 1.6.51-r0 CVE-2026-22801 HIGH
libpng-dev 1.6.51-r0 CVE-2025-66293 HIGH
libpng-dev 1.6.51-r0 CVE-2026-22695 HIGH
libpng-dev 1.6.51-r0 CVE-2026-22801 HIGH
libssl3 3.5.4-r0 CVE-2025-15467 CRITICAL
libssl3 3.5.4-r0 CVE-2025-69419 HIGH
libxml2 2.13.8-r0 CVE-2025-49794 CRITICAL
libxml2 2.13.8-r0 CVE-2025-49796 CRITICAL
libxml2 2.13.8-r0 CVE-2025-49795 HIGH
libxml2 2.13.8-r0 CVE-2025-6021 HIGH
openssl 3.5.4-r0 CVE-2025-15467 CRITICAL
openssl 3.5.4-r0 CVE-2025-69419 HIGH
openssl-dev 3.5.4-r0 CVE-2025-15467 CRITICAL
openssl-dev 3.5.4-r0 CVE-2025-69419 HIGH
py3-urllib3 1.26.20-r0 CVE-2026-21441 HIGH
py3-urllib3-pyc 1.26.20-r0 CVE-2026-21441 HIGH
github.com/containerd/containerd/v2 v2.0.2 CVE-2024-25621 HIGH
golang.org/x/crypto v0.31.0 CVE-2025-22869 HIGH
golang.org/x/oauth2 v0.24.0 CVE-2025-22868 HIGH
stdlib 1.22.10 CVE-2025-47907 HIGH
stdlib 1.22.10 CVE-2025-58183 HIGH
stdlib 1.22.10 CVE-2025-61726 HIGH
stdlib 1.22.10 CVE-2025-61728 HIGH
stdlib 1.22.10 CVE-2025-61729 HIGH

Source Code Scan Results

🎉 No vulnerabilities found!

@ChiragAgg5k ChiragAgg5k force-pushed the fix-deprecation-warnings branch from a2a5d22 to 742dcd8 Compare February 3, 2026 04:29
Copy link
Contributor
@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

🤖 Fix all issues with AI agents
In `@src/Appwrite/Utopia/Database/Documents/User.php`:
- Line 134: The method signature for tokenVerify currently uses an optional
parameter with a default (?int $type = null) followed by required parameters,
causing a PHP 8.x deprecation; update the tokenVerify declaration to remove the
default value so the parameter reads ?int $type (i.e., change from ?int $type =
null to ?int $type) in the User::tokenVerify method, leaving the rest of the
signature and logic unchanged since all call sites already pass the $type
explicitly.
🧹 Nitpick comments (1)
src/Appwrite/Platform/Modules/Compute/Base.php (1)

147-147: Remove unused $request parameter from both methods - requires coordinated updates across multiple callers.

Both redeployVcsSite (line 147) and redeployVcsFunction (line 56) have unused $request parameters. However, removing this parameter is a breaking change that requires updating callers:

  • Positional argument calls in Update.php files (2 instances in Sites and Functions modules) will break if the parameter is removed
  • Named parameter calls in Create.php files use named arguments and would remain unaffected

If proceeding with this refactor, ensure all positional calls are updated to remove the $request argument, or convert them to named parameter style.

@ChiragAgg5k ChiragAgg5k force-pushed the fix-deprecation-warnings branch from 742dcd8 to 6c43949 Compare February 3, 2026 04:41
Copy link
Contributor
@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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/Appwrite/Utopia/Database/Documents/User.php (1)

177-179: ⚠️ Potential issue | 🟡 Minor

Dead code: duplicate return false; statement.

Line 179 is unreachable due to the return false; on line 177. This appears to be an accidental duplication.

🧹 Proposed fix
         return false;
-
-        return false;
     }
 }
🧹 Nitpick comments (2)
src/Appwrite/Platform/Action.php (1)

43-47: LGTM! Consider updating the docblock for consistency.

The nullable type hint ?callable $callback = null is correct and aligns with PHP 8.3 guidance. The existing is_callable($callback) guards ensure safe invocation.

The docblock on line 43 still documents @param callable $callback — consider updating to @param callable|null $callback for consistency.

,

📝 Suggested docblock update
    /**
     * Foreach Document
     * Call provided callback for each document in the collection
     *
     * `@param` string $projectId
     * `@param` string $collection
     * `@param` array $queries
-    * `@param` callable $callback
+    * `@param` callable|null $callback
     *
     * `@return` void
     */
src/Appwrite/Platform/Modules/Compute/Base.php (1)

147-147: Remove the unused $request parameter or suppress the PHPMD warning.

The $request parameter at line 147 is never referenced in the method body and has no interface or parent class constraints. Either remove it if there are no backward compatibility concerns, or add a @SuppressWarnings(PHPMD.UnusedFormalParameter) annotation with a comment explaining why it must remain.

@github-actions
Copy link
github-actions bot commented Feb 3, 2026

✨ Benchmark results

  • Requests per second: 2,546
  • Requests with 200 status code: 458,382
  • P99 latency: 0.06057454

⚡ Benchmark Comparison

Metric This PR Latest version
RPS 2,546 1,244
200 458,382 223,942
P99 0.06057454 0.165208897

@ChiragAgg5k ChiragAgg5k merged commit 92d2310 into 1.8.x Feb 3, 2026
72 of 73 checks passed
@ChiragAgg5k ChiragAgg5k deleted the fix-deprecation-warnings branch February 3, 2026 05:49
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

0