Skip to content

refactor(command): change structure application layer - #99

Open
holiq wants to merge 4 commits into
KoalaFacade:3xfrom
holiq:3x
Open

refactor(command): change structure application layer#99
holiq wants to merge 4 commits into
KoalaFacade:3xfrom
holiq:3x

Conversation

@holiq

@holiq holiq commented Oct 21, 2023

Copy link
Copy Markdown
Member

#95

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

what-the-diff Bot commented Oct 21, 2023

Copy link
Copy Markdown

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