Skip to content

Conversation

@owaisahmed5300
Copy link
Contributor

Summary

This PR updates the ReferenceUsedNamesOnly sniff configuration to prevent importing PHP
built-in functions and constants while keeping strict importing rules for namespaced symbols.

Changes

  • Enabled allowFallbackGlobalFunctions
  • Enabled allowFallbackGlobalConstants
  • Allowed fully qualified global classes, functions, and constants
  • Kept partial uses disabled for clarity
  • Ensured namespaced symbols still require imports

Why

The previous configuration caused PHPCS and PHPCBF to auto-insert use function statements
for built-in functions like array_map() and implode(). This added noise and did not match
common PHP coding style.

Impact

  • Cleaner diffs
  • More predictable code style
  • No breaking changes

…uleset

Updated the ReferenceUsedNamesOnly configuration to avoid importing built-in PHP functions and
constants. Namespaced symbols continue to require imports. This makes the coding standard more
natural and aligned with typical PHP coding practices.
@owaisahmed5300 owaisahmed5300 merged commit 69e3f3d into main Nov 26, 2025
1 check passed
@owaisahmed5300 owaisahmed5300 deleted the feat/ignore-builtin-imports branch November 27, 2025 07:54
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