Skip to content

Correct GearmanClient unique parameters - #6241

Merged
staabm merged 1 commit into
phpstan:2.2.xfrom
donatj:fix/nullable-strings-on-gearman-unique
Sep 19, 2026
Merged

staabm merged 1 commit into
phpstan:2.2.xfrom
donatj:fix/nullable-strings-on-gearman-unique

Conversation

Copilot AI lite review requested due to automatic review settings August 19, 2026 21:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates PHPStan’s internal functionMap.php signature metadata for the Gearman extension so that GearmanClient methods reflect that the unique argument is nullable where the PHP manual documents it as such (unique = null).

Changes:

  • Marked unique= as ?string for GearmanClient::addTask* methods.
  • Marked unique= as ?string for GearmanClient::do* methods (excluding deprecated GearmanClient::do, as noted in the PR description).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread resources/functionMap.php
'GearmanClient::clone' => ['GearmanClient'],
'GearmanClient::context' => ['string'],
'GearmanClient::data' => ['string'],
'GearmanClient::do' => ['string', 'function_name'=>'string', 'workload'=>'string', 'unique='=>'string'],

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

GearmanClient::do does not accept ?string, omitted from the changes.

https://www.php.net/manual/en/gearmanclient.do.php

@donatj

donatj commented Aug 19, 2026

Copy link
Copy Markdown
Contributor Author

I suspect the failing CI is nothing to do with me from what I can tell?

@staabm
staabm requested a lite review from Copilot September 19, 2026 17:27
- Marks `unique=` as `?string` on `addTask*` and `do*` methods

The ext-gearman signatures accept null for the optional unique key, so passing null was flagged as an error.
@staabm
staabm force-pushed the fix/nullable-strings-on-gearman-unique branch from 2396439 to 9eeb277 Compare September 19, 2026 17:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

No unresolved review issues remain.

Review effort: Lite
Findings: None

@staabm
staabm merged commit 1cb1170 into phpstan:2.2.x Sep 19, 2026
501 of 506 checks passed
@staabm

staabm commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

thank you!

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