Skip to content

Enable ambiguous-function-call mago rule#12

Closed
Scarbous wants to merge 1 commit into
mainfrom
worktree-import-compiler-optimized-functions
Closed

Enable ambiguous-function-call mago rule#12
Scarbous wants to merge 1 commit into
mainfrom
worktree-import-compiler-optimized-functions

Conversation

@Scarbous

Copy link
Copy Markdown
Member

Summary

  • Mago's ambiguous-function-call lint rule was disabled in mago.toml. It flags unqualified calls to global functions that PHP can't resolve at compile time (preventing an optimization), recommending a leading \ or a use function import instead.
  • Fully-qualified the three remaining offenders — defined() in AbstractNodeProcessor::getNodePath(), and get_class()/iterator_to_array() in the unit tests — and re-enabled the rule.

Test plan

  • vendor/bin/mago lint --only ambiguous-function-call src/ tests/ reports no issues
  • vendor/bin/phpunit --testdox --testsuite unit passes (49 tests, 1 pre-existing skip unrelated to this change)

🤖 Generated with Claude Code

Fully-qualify the three global function calls (defined, get_class,
iterator_to_array) that were resolved ambiguously at compile time, so
the ambiguous-function-call linter rule can be turned on instead of
disabled.
@github-actions

Copy link
Copy Markdown

Code Coverage

Package Line Rate Health
features/NodeProcessor/ArrayNodeProcessor.php 100%
features/NodeProcessor/InvokeNodeProcessorInterface.php 0%
features/NodeProcessor/TextNodeProcessor.php 100%
src/NodeProcessor/AbstractNodeProcessor.php 100%
src/NodeProcessor/CloseNodeProcessorInterface.php 0%
src/NodeProcessor/Context/AbstractElementContext.php 100%
src/NodeProcessor/Context/CloseContext.php 0%
src/NodeProcessor/Context/NodeProcessorContext.php 100%
src/NodeProcessor/Context/OpenContext.php 100%
src/NodeProcessor/Context/TextContext.php 100%
src/NodeProcessor/NodeProcessorInterface.php 0%
src/NodeProcessor/OpenNodeProcessorInterface.php 0%
src/NodeProcessor/TextNodeProcessorInterface.php 0%
src/XmlProcessor.php 93%
src/XmlProcessorContext.php 100%
Summary 96% (140 / 146)

Minimum allowed line rate is 60%

@Scarbous Scarbous closed this Jul 17, 2026
@Scarbous
Scarbous deleted the worktree-import-compiler-optimized-functions branch July 17, 2026 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant