Skip to content

Use named arguments for unreadable function/static/new calls with many null/true/false parameters#4869

Merged
ondrejmirtes merged 1 commit into2.1.xfrom
claude/improve-function-call-readability-wSUWS
Feb 11, 2026
Merged

Use named arguments for unreadable function/static/new calls with many null/true/false parameters#4869
ondrejmirtes merged 1 commit into2.1.xfrom
claude/improve-function-call-readability-wSUWS

Conversation

@ondrejmirtes
Copy link
Member

Refactored calls across the codebase where positional null, true, false, and [] arguments made it impossible to understand what each parameter means without looking up the function signature. Key improvements:

  • ResultCache constructor (14 params, 9 consecutive empty arrays)
  • AnalyserResult constructor (13 params, 11 empty arrays + false)
  • InternalStatementResult/ExpressionResult (false, false, [], [], [])
  • DummyParameter/NativeParameterReflection (false, ..., false, null)
  • InitializerExprContext::createEmpty() (7 consecutive nulls)
  • ClosureType::createPure() (null, null, true, null, null, null, [], [], [])
  • IgnoredError::shouldIgnore() (multiple trailing nulls)
  • getFunctionType() (false, false)
  • narrowType() (false, false / false, true)
  • StubValidator constructor calls (true, true, true, false)
  • AssertTag/AssertTagParameter (trailing nulls/booleans)
  • IgnoredRegexValidatorResult (false, false / false, true)
  • FileTypeMapper::getResolvedPhpDoc() (null, null, null)
  • ResultCacheManager::restore() / AnalyserResultFinalizer::finalize()

https://claude.ai/code/session_01Tf5zvkNk4w3dp6TU7UM8b6

@ondrejmirtes ondrejmirtes force-pushed the claude/improve-function-call-readability-wSUWS branch from 3e75799 to 79ddfce Compare February 11, 2026 13:29
@ondrejmirtes ondrejmirtes merged commit 5930232 into 2.1.x Feb 11, 2026
19 checks passed
@ondrejmirtes ondrejmirtes deleted the claude/improve-function-call-readability-wSUWS branch February 11, 2026 13:29
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