Skip to content

docs: 💡 improve code documentation#36

Merged
andrewdyer merged 42 commits into
mainfrom
chore/config
May 23, 2026
Merged

docs: 💡 improve code documentation#36
andrewdyer merged 42 commits into
mainfrom
chore/config

Conversation

@andrewdyer
Copy link
Copy Markdown
Owner

This pull request updates and improves code documentation and type annotations across the user management modules and project bootstrap files. The main focus is on clarifying and standardizing PHPDoc comments, improving function signatures, and enhancing overall code readability and maintainability. No functional or behavioral code changes are introduced.

Documentation improvements:

Type and signature enhancements:

  • Added or improved parameter and return type hints for helper functions in app/helpers.php, including root_path, get_env, get_env_array, and require_from_root. [1] [2] [3] [4]

Code style configuration:

  • Changed the .php-cs-fixer.dist.php configuration to disable the phpdoc_to_comment rule, ensuring all PHPDoc blocks are preserved as PHPDoc rather than converted to regular comments.

andrewdyer added 30 commits May 23, 2026 00:13
Clarify the parameter and return type in the root_path function documentation.
Clarify the parameter types for the get_env function.
Change get_env to use typed parameters and return type for better clarity.
Change the parameter type of root_path to explicitly accept a string.
Change require_from_root function to explicitly return mixed type.
Eliminate unnecessary comment about constructor injection in the base user action class.
Clarify the purpose of the constructor and its parameters.
Clarify the purpose of the handle method in the CreateUserAction class.
Clarify the purpose of the handle method in CreateUserAction.
Clarify the purpose of the handle method in DeleteUserAction.
Clarify the purpose of the handle method in ListUsersAction.
Clarify the purpose of the handle method in ShowUserAction.
Clarify the purpose of the handle method in ShowUserAction.
Remove unnecessary comment about usage in CreateUserAction.
Clarify the purpose of the constructor in CreateUserDTO.
Remove unnecessary comments to clarify the purpose of UpdateUserDTO.
Clarify the constructor's purpose in the UpdateUserDTO class.
Remove redundant constructor description for clarity.
Change the verb in the constructor documentation to improve clarity.
Clarify the purpose of the jsonSerialize method in UserResponseDTO.
Clarify method descriptions to improve understanding of user-related application logic.
Clarify constructor and jsonSerialize method descriptions.
Clarify method descriptions and remove redundant comments.
Clarify method descriptions and add context for usage in development and testing.
Clarify the purpose of the InMemoryUserRepository as a pre-populated user repository.
Clarify the purpose of the get_env_array function in the docblock.
Clarify that the function returns the result of requiring a file relative to the project root.
Clarify parameter and return value in the require_from_root function documentation.
Clarify the purpose of the InMemoryUserRepository constructor in the documentation.
Clarify that the constructor creates a new repository pre-populated with sample users.
Eliminate the void return type annotation from the setUp method in AbstractUsersTestCase.
Clarify the purpose of the constructor in UserFactory class.
Add descriptions for the repository instance and setup method in the test class.
Clarify the return type annotation for the invalidPayloadProvider method in CreateUserDTOTest.
Improve readability by adjusting the array formatting in invalidPayloadProvider.
Add descriptive comments for application setup in app.php, dependencies.php, middleware.php, repositories.php, routes.php, and settings.php.
@andrewdyer andrewdyer requested a review from Copilot May 23, 2026 00:07
@andrewdyer andrewdyer changed the title docs: 💡: improve code documentation docs: 💡 improve code documentation May 23, 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 focuses on improving PHPDoc documentation and tightening type signatures across the user-management modules and bootstrap/helpers, aiming to make the template easier to understand and maintain without changing runtime behavior.

Changes:

  • Standardized/clarified PHPDoc summaries across user actions, DTOs, domain types, repositories, and services.
  • Added descriptive docblocks to bootstrap registration files and improved docblocks in tests/factories.
  • Strengthened helper function signatures and documentation (e.g., root_path(), get_env(), require_from_root()), and adjusted PHP-CS-Fixer config to preserve PHPDoc.

Reviewed changes

Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/Unit/Infrastructure/Persistence/User/InMemoryUserRepositoryTest.php Adds property/setup docblocks to improve test readability.
tests/Unit/Application/Users/DTOs/CreateUserDTOTest.php Improves provider docblock and array formatting for clarity.
tests/Support/Factories/UserFactory.php Refines constructor doc wording for consistency.
tests/Integration/Application/Users/AbstractUsersTestCase.php Removes redundant @return void from setUp() docblock.
bootstrap/settings.php Adds a brief docblock describing settings registration.
bootstrap/routes.php Adds a brief docblock describing route registration.
bootstrap/repositories.php Adds a brief docblock describing repository bindings.
bootstrap/middleware.php Adds a brief docblock describing middleware registration.
bootstrap/dependencies.php Adds a brief docblock describing service dependency registration.
bootstrap/app.php Adds a brief docblock for app construction and minor formatting.
app/Infrastructure/Persistence/User/InMemoryUserRepository.php Adjusts repository/method PHPDoc summaries.
app/helpers.php Adds/clarifies PHPDoc and strengthens parameter/return type declarations.
app/Domain/User/UserRepository.php Simplifies interface docblock and refines method summary wording.
app/Domain/User/User.php Simplifies class docblock and refines method summaries.
app/Application/Users/Services/UserService.php Simplifies class docblock and refines method summaries.
app/Application/Users/DTOs/UserResponseDTO.php Simplifies class docblock and refines serialization doc.
app/Application/Users/DTOs/UpdateUserDTO.php Simplifies class docblock and refines constructor doc.
app/Application/Users/DTOs/CreateUserDTO.php Simplifies class docblock and refines constructor doc.
app/Application/Users/Actions/UpdateUserAction.php Updates action doc summary to a consistent “Handles …” style.
app/Application/Users/Actions/ShowUserAction.php Updates action doc summary to a consistent “Handles …” style.
app/Application/Users/Actions/ListUsersAction.php Updates action doc summary to a consistent “Handles …” style.
app/Application/Users/Actions/DeleteUserAction.php Updates action doc summary to a consistent “Handles …” style.
app/Application/Users/Actions/CreateUserAction.php Updates action doc summary to a consistent “Handles …” style.
app/Application/Users/Actions/AbstractUserAction.php Simplifies base action docblock and constructor summary.
.php-cs-fixer.dist.php Disables phpdoc_to_comment to keep PHPDoc blocks intact.

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

Comment thread app/Infrastructure/Persistence/User/InMemoryUserRepository.php
Clarify the purpose of the InMemoryUserRepository for development and testing.
Removed unnecessary annotation tags
Removed redundant comment about shared setup for UserRepository and UserFactory.
Clarify the purpose of the setUp and tearDown methods in HelpersTest.
Clarify the description of the get_env function to improve understanding.
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

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

@andrewdyer andrewdyer merged commit d3472f8 into main May 23, 2026
2 checks passed
@andrewdyer andrewdyer deleted the chore/config branch May 23, 2026 23:40
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