Skip to content

Use use for all functions for those free extra nanoseconds#25

Merged
spaze merged 1 commit intomainfrom
spaze/use-use
Apr 10, 2026
Merged

Use use for all functions for those free extra nanoseconds#25
spaze merged 1 commit intomainfrom
spaze/use-use

Conversation

@spaze
Copy link
Copy Markdown
Owner

@spaze spaze commented Apr 10, 2026

No description provided.

@spaze spaze requested a review from Copilot April 10, 2026 00:18
@spaze spaze self-assigned this Apr 10, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR standardizes calls to global PHP functions/constants by importing them with use function / use const, avoiding fully-qualified references and namespace fallback resolution in the library and its tests.

Changes:

  • Import frequently used global PHP functions in test files (session_*, sprintf, urlencode).
  • Import global PHP functions/constants in src/PhpInfo.php and switch default flags from \INFO_ALL to INFO_ALL via use const INFO_ALL.
  • Import global functions in src/SensitiveValueSanitizer.php and switch \session_name() to session_name() via use function session_name.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/SensitiveValueSanitizerTest.phpt Adds use function imports for session and string helpers used in the test.
tests/SensitiveValueSanitizerNoSessionTest.phpt Adds use function imports for session_name, sprintf, and urlencode.
tests/PhpInfoTest.phpt Adds use function imports for session helpers used in setup/teardown.
src/SensitiveValueSanitizer.php Imports global helpers and uses imported session_name() instead of \session_name().
src/PhpInfo.php Imports global output/string helpers and INFO_ALL, then uses INFO_ALL as the default flag.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@spaze spaze merged commit ae9832a into main Apr 10, 2026
28 checks passed
@spaze spaze deleted the spaze/use-use branch April 10, 2026 00:21
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