Skip to content

fix implicit nullable in MockObject Generator::generate()#27

Merged
falkenhawk merged 1 commit intomasterfrom
fix-mock-objects-nullable
Apr 3, 2026
Merged

fix implicit nullable in MockObject Generator::generate()#27
falkenhawk merged 1 commit intomasterfrom
fix-mock-objects-nullable

Conversation

@falkenhawk
Copy link
Copy Markdown
Member

@falkenhawk falkenhawk commented Apr 3, 2026

array $methods = NULL in Generator::generate() triggers deprecation on php 8.4. Missed in the 3.7.44 release because it's in deps/phpunit-mock-objects which wasn't included in the nullable parameter fix pass.

Removes the array type hint and adds a runtime check, same pattern as the other nullable fixes in PR #25.

Manifests as test failures in consumers (e.g. zf1s/zf1) when any test uses $this->getMock() without specifying methods - phpunit's own test suite doesn't exercise this code path on 8.4.

`array $methods = NULL` triggers deprecation on php 8.4.
Missed in the 3.7.44 release because it's in deps/phpunit-mock-objects
which wasn't included in the nullable parameter fix pass.
@falkenhawk falkenhawk merged commit bcdc014 into master Apr 3, 2026
30 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.

1 participant