docs: 💡 improve code documentation#36
Merged
Merged
Conversation
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.
There was a problem hiding this comment.
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Standardized and clarified PHPDoc comments for all user-related action classes, DTOs, service, repository, and domain entity files, focusing on concise and accurate method and class descriptions. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23]
Added or improved file-level docblocks for all
bootstrap/*.phpfiles, explaining their purpose and the main function they register. [1] [2] [3] [4] [5]Type and signature enhancements:
app/helpers.php, includingroot_path,get_env,get_env_array, andrequire_from_root. [1] [2] [3] [4]Code style configuration:
.php-cs-fixer.dist.phpconfiguration to disable thephpdoc_to_commentrule, ensuring all PHPDoc blocks are preserved as PHPDoc rather than converted to regular comments.