Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(command): change structure application layer #99

Open
wants to merge 4 commits into
base: 3x
Choose a base branch
from

Conversation

holiq
Copy link
Member

@holiq holiq commented Oct 21, 2023

#95

@holiq holiq requested a review from pemudakoding October 21, 2023 15:36
@holiq holiq self-assigned this Oct 21, 2023
@what-the-diff
Copy link

what-the-diff bot commented Oct 21, 2023

PR Summary

  • Refactor Code To Support Console Interactions
    The solution has undergone extensive changes to support an improved console interaction model. A set of files (DataTransferObjectMakeCommand.php, RequestMakeCommand.php, ResourceMakeCommand.php) have had outdated code (InteractsWithConsoleInApplication) replaced with InteractsWithConsole, providing better efficiency. Additionally, these files now include two new methods, beforeCreate() and afterCreate(), to potentially increase the control flow.

  • Enhanced Placeholder Management
    To improve data structure, an adjustment was made to resolvePlaceholders() method across a number of files. Now, instead of its previous return type, it provides an instantiation of the PlaceholderData class, contributing to code readability and ease of data manipulation.

  • File Movement and Deletion
    In an effort to maintain a cleaner codebase, the file ProviderMakeCommand.php was relocated from src/Commands/Infrastructure/ to src/Commands/Application/. Similarly, provider.stub was moved from stubs/infrastructure/ to stubs/application/. Moreover, the file InteractsWithConsoleInApplication.php was deleted due to its redundancy.

  • Unit Test Modifications
    A brand-new test file was introduced (ProviderMakeCommandTest.php), providing wider test coverage. Other test files (DataTransferObjectMakeCommandTest.php, RequestMakeCommandTest.php and ResourceMakeCommandTest.php) underwent changes in their internal logic and file system interactions for improved accuracy and simplicity. Changes include replacing standard 'File' and 'Artisan' interactions with custom function calls like fileExists() and fileGet(), or properly scoped Artisan calls.

This pull request aims to improve the overall integrity of the code, reduce redundancy, simplify testing and enhance maintainability.

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.

1 participant