Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the CheckCommand class to replace direct exec() calls with Magento's Shell service for checking versions of system tools (Node.js, MySQL client, Composer, npm, and Git). This improves code safety, error handling consistency, and adherence to Magento framework best practices. Additionally, it includes a minor documentation cleanup in the BlockCacheCollector class.
Changes:
- Replaced all direct
exec()usage with Magento'sShellservice inCheckCommandfor improved security and error handling - Added
Shellservice dependency injection toCheckCommandconstructor - Removed unused
@packageannotation fromBlockCacheCollectordocblock
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Service/Inspector/Cache/BlockCacheCollector.php | Removed unused @package annotation from class docblock |
| src/Console/Command/System/CheckCommand.php | Refactored system tool version checking methods to use Shell service instead of direct exec calls, added Shell service dependency injection |
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 refactors how system tool versions are checked in the
CheckCommandclass by replacing directexeccalls with Magento'sShellservice. This change improves code safety, error handling, and consistency across all version-checking methods. Additionally, there is a minor cleanup in theBlockCacheCollectorclass.Refactoring system tool version checks:
execusage with theShellservice for checking versions of Node.js, MySQL client, Composer, npm, and Git inCheckCommand, improving error handling and code safety. (src/Console/Command/System/CheckCommand.php) [1] [2] [3] [4] [5]CheckCommandto inject theShellservice. (src/Console/Command/System/CheckCommand.php) [1] [2]Minor cleanup:
@packageannotation from theBlockCacheCollectorclass docblock. (src/Service/Inspector/Cache/BlockCacheCollector.php)