Skip to content

Conversation

@BrookeDot
Copy link
Contributor

@BrookeDot BrookeDot commented Jul 4, 2025

Description

Updates the src/Pods/REST/V1/Endpoints/Base.php file to explicitly mark the parameters as nullable instead of implicitly, which is deprecated.

Note that some additional testing would be appreciated with older PHP versions. I went with ? instead of |null for better backwards compatibility. This method should be supported in PHP 7.1 and above:
https://www.php.net/manual/en/migration71.new-features.php

Related GitHub issue(s)

Partly fixes #7401 after this PR all that is left is to fix the vendor errors in the DI52 package

Testing instructions

  1. Enable the Pods plugin on an env with PHP Warnings and a modern version of PHP enabled (ie PHP 8.4)
  2. You will see the PHP warning regarding the REST API
  3. Enable the PR
  4. Like magic the warnings go away!

Changelog text for these changes

Enhancement: Remove PHP Deprecation warnings for Pod's REST API. #7401 (@BrookeDot)

PR checklist

@BrookeDot BrookeDot mentioned this pull request Jul 4, 2025
2 tasks
@sc0ttkclark sc0ttkclark changed the base branch from release/3.4.0 to release/3.3.2 July 7, 2025 13:59
@sc0ttkclark sc0ttkclark force-pushed the fix/php8.4-warnings branch from f758366 to e560bfc Compare July 7, 2025 14:00
@what-the-diff
Copy link

what-the-diff bot commented Jul 7, 2025

PR Summary

  • Enhanced Type Safety: The initialization method for the base unit of our software now has improved safeguards to ensure that the input matches the expected types. This helps prevent potential issues that might arise from unexpected data types.
  • Improved Code Readability: The method responsible for ensuring that proper and required information is provided has been reformatted. This results in better readability which aids in smoother development and maintenance.
  • Better Error Information: If a requested item is not found when trying to update it, the error messages have been enhanced to include the information of the failed request for better understanding and debugging.
  • Flexible Request handling: The method for getting objects based on certain parameters now allows for instances where no parameter is provided. Again, this ensures improved flexibility and safeguards against potential issues.

@sc0ttkclark sc0ttkclark force-pushed the fix/php8.4-warnings branch from e560bfc to 772336b Compare July 7, 2025 14:23
sc0ttkclark
sc0ttkclark previously approved these changes Jul 7, 2025
@sc0ttkclark sc0ttkclark merged commit 11bc821 into pods-framework:release/3.3.2 Jul 7, 2025
9 of 11 checks 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