Skip to content

Fix #14499: Mark Lua::__construct $lua_script_file parameter as optional#5571

Merged
staabm merged 1 commit intophpstan:2.1.xfrom
predictor2718:fix-14499
Apr 29, 2026
Merged

Fix #14499: Mark Lua::__construct $lua_script_file parameter as optional#5571
staabm merged 1 commit intophpstan:2.1.xfrom
predictor2718:fix-14499

Conversation

@predictor2718
Copy link
Copy Markdown
Contributor

Lua::__construct in resources/functionMap.php incorrectly marked $lua_script_file as required, causing a false positive "Class Lua constructor invoked with 0 parameters, 1 required." Fix: add = suffix to make the parameter optional, matching the PHP documentation and phpstorm-stubs definition.

Closes phpstan/phpstan#14499

Comment thread tests/PHPStan/Rules/Classes/data/bug-14499.php
@VincentLanglet VincentLanglet requested a review from staabm April 29, 2026 20:18
@staabm staabm merged commit 514f40e into phpstan:2.1.x Apr 29, 2026
655 of 658 checks passed
@staabm
Copy link
Copy Markdown
Contributor

staabm commented Apr 29, 2026

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.

3 participants