Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PHP 8.4] Fixes for implicit nullability deprecation #20133

Merged
merged 3 commits into from
Mar 26, 2024

Conversation

Ayesh
Copy link
Contributor

@Ayesh Ayesh commented Mar 20, 2024

Fixes all issues that emit deprecation notices on PHP 8.4 for implicit nullable parameter type declarations. Related to #20128. This is against the master branch while the other PR targets the 2.2 branch.

See:

Q A
Is bugfix? ✔️
New feature?
Breaks BC?
Fixed issues N/A

Fixes all issues that emit deprecation notices on PHP 8.4 for implicit nullable parameter type declarations.
Related to yiisoft#20128. This is against the `master` branch while the other PR targets the `2.2` branch.

See:
 - [RFC](https://wiki.php.net/rfc/deprecate-implicitly-nullable-types)
 - [PHP 8.4: Implicitly nullable parameter declarations deprecated](https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated)
Copy link

what-the-diff bot commented Mar 20, 2024

PR Summary

  • Enhanced Code Clarity in Framework
    Nullability annotations were added to the 'trigger' method in the base component of our framework, resulting in improved code readability and maintainability.

  • Database Active Query Improvement
    The viaTable and via methods in ActiveQuery & ActiveRelationTrait received nullability annotations. This helps developers quickly understand when a null value is expected and reduces potential errors and bugs.

  • Mail System Code Quality Improvement
    We improved the robustness of the mail system by annotating the send method in our BaseMessage and MessageInterface with nullability, highlighting that these methods can handle null values.

  • Improved Code Definition in Tests
    Numerous test files, such as FakePhp71Controller, ContainerTest, stubs/Alpha, and FakePhp7Controller, have been annotated for nullability on various parameters. This allows for better understanding of these tests since developers can now anticipate null values during execution.

Copy link

codecov bot commented Mar 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.64%. Comparing base (ac1a5af) to head (da5f809).

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #20133      +/-   ##
============================================
- Coverage     64.82%   63.64%   -1.19%     
  Complexity    11376    11376              
============================================
  Files           429      429              
  Lines         37074    37073       -1     
============================================
- Hits          24034    23594     -440     
- Misses        13040    13479     +439     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@terabytesoftw terabytesoftw added this to the 2.0.50 milestone Mar 21, 2024
@samdark samdark merged commit a292af1 into yiisoft:master Mar 26, 2024
72 of 73 checks passed
@samdark
Copy link
Member

samdark commented Mar 26, 2024

Thank you!

@Ayesh Ayesh deleted the php84/nullability-master branch March 26, 2024 08:29
@Ayesh
Copy link
Contributor Author

Ayesh commented Mar 26, 2024

Thank you for triaging and coordinating this.

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.

4 participants