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

Make some other nullable parameters explicitly nullable #1220

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

jorgeatorres
Copy link
Member

Here we continue the work started in #1205, where most function parameters that are implicitly nullable were explicitly marked as nullable. That is, function definitions such as

public function __construct( ActionScheduler_Store $store = null, $batch_size = 20 )

were turned into

public function __construct( ?ActionScheduler_Store $store = null, $batch_size = 20 ) {

(Notice the type change in the $store argument).

We missed a couple instances of these nullable args in the prior PR and so that's what this one adds. The aim is to reduce noise when running A-S (or a plugin that bundles A-S) under PHP 8.4.

@jorgeatorres jorgeatorres requested review from a team and coreymckrill and removed request for a team December 6, 2024 19:59
Copy link
Contributor

@coreymckrill coreymckrill left a comment

Choose a reason for hiding this comment

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

👍 Did a quick smoke test and everything looks fine.

Copy link
Contributor

Choose a reason for hiding this comment

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

Given that this is a 3rd party library, I wondered if we should be directly editing the files in it. It looks like it is abandoned, which might be why we've got it under version control rather than as a composer dependency. At some point, the package was forked, and the new maintainer is still active. The latest version does add the necessary nullable type, but the readme also says there are breaking changes since the version that we're using.

So in short, probably fine to edit this file, but perhaps we should look into updating this to a composer dependency using the latest version, both for PHP compatibility reasons, and also potentially security reasons.

Copy link
Contributor

Choose a reason for hiding this comment

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

Opened an issue for this: #1221

Copy link
Member Author

Choose a reason for hiding this comment

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

Thank you @coreymckrill! 💯 Same thought crossed my mind when I was modifying that file but forgot to mention it in the description.

@coreymckrill coreymckrill merged commit b2f889a into trunk Dec 6, 2024
34 checks passed
@coreymckrill coreymckrill deleted the fix/php84-more-nullables branch December 6, 2024 20:46
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