Skip to content

Conversation

@EdmondDantes
Copy link
Contributor

No description provided.

Updated function names from camelCase to snake_case to follow official PHP
coding standards for function naming conventions.

Breaking Changes:
- spawnWith() → spawn_with()
- awaitAnyOrFail() → await_any_or_fail()
- awaitFirstSuccess() → await_first_success()
- awaitAllOrFail() → await_all_or_fail()
- awaitAll() → await_all()
- awaitAnyOfOrFail() → await_any_of_or_fail()
- awaitAnyOf() → await_any_of()
- currentContext() → current_context()
- coroutineContext() → coroutine_context()
- currentCoroutine() → current_coroutine()
- rootContext() → root_context()
- getCoroutines() → get_coroutines()
- gracefulShutdown() → graceful_shutdown()

Changes:
- Updated async.stub.php with new function names
- Regenerated async_arginfo.h
- Updated PHP_FUNCTION declarations in async.c
- Updated all 137 test files with new function names and use statements
- Added breaking change documentation to CHANGELOG.md

Reference: https://github.com/php/policies/blob/main/coding-standards-and-naming.rst
@EdmondDantes EdmondDantes linked an issue Dec 16, 2025 that may be closed by this pull request
@EdmondDantes EdmondDantes requested a review from Copilot December 16, 2025 13:19
Copy link

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 pull request aligns the codebase with PHP coding standards by renaming functions from camelCase to snake_case. This is a breaking change that affects all async function names.

Key Changes:

  • Renamed 13 async functions to use snake_case convention (e.g., awaitAll()await_all(), spawnWith()spawn_with())
  • Updated all test files (160+ files) to use the new function names
  • Updated C implementation files (async.c, async_arginfo.h, async.stub.php) with new function names
  • Applied code formatting improvements to scheduler.c and libuv_reactor.c
  • Documented breaking changes in CHANGELOG.md

Reviewed changes

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

Show a summary per file
File Description
async.stub.php Updated PHP stub definitions with new snake_case function names
async_arginfo.h Regenerated argument info with updated function signatures
async.c Renamed PHP_FUNCTION declarations; minor brace placement issue found
scheduler.c Code formatting improvements for multi-line conditionals
libuv_reactor.c Minor formatting fixes and comment correction
CHANGELOG.md Comprehensive documentation of all renamed functions
tests/* (160+ files) Updated all test files to use new function names in imports and calls

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

@EdmondDantes EdmondDantes merged commit bcc1f4b into main Dec 16, 2025
7 checks passed
@EdmondDantes EdmondDantes deleted the 72-align-coding-standards-and-naming branch December 16, 2025 13:32
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.

Align coding-standards-and-naming

2 participants