-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: second stage - InitCommand cleanup #72
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
base: main
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 18585764876Details
💛 - Coveralls |
There was a problem hiding this 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 refactors the InitCommand
class by extracting README generation logic into a dedicated ReadmeGenerator
class, improving code organization and maintainability.
Key Changes:
- Introduced
ReadmeGenerator
class to handle all README-related operations - Reorganized
InitCommand
properties and methods for better logical grouping - Updated test mocks to reflect the new separation of concerns
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
File | Description |
---|---|
src/Generators/ReadmeGenerator.php |
New class extracting README generation logic from InitCommand |
src/Commands/InitCommand.php |
Refactored to use ReadmeGenerator and reorganized method/property order |
tests/InitCommandTest.php |
Updated mocks to separate InitCommand and ReadmeGenerator namespace calls |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
$this->callFileGetContent($this->generateResourcePath('md/readme/CONTACTS.md'), $this->getReadmeTemplateContent('CONTACTS.md')), | ||
$this->callFileGetContent($this->generateResourcePath('md/readme/ENVIRONMENTS.md'), $this->getReadmeTemplateContent('ENVIRONMENTS.md')), | ||
$this->callFileGetContent($this->generateResourcePath('md/readme/CREDENTIALS_AND_ACCESS.md'), $this->getReadmeTemplateContent('CREDENTIALS_AND_ACCESS.md')), | ||
|
Copilot
AI
Oct 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty line contains trailing whitespace. Remove the whitespace to maintain code cleanliness.
Copilot uses AI. Check for mistakes.
$this->callFileGetContent($this->generateResourcePath('md/readme/ENVIRONMENTS.md'), $this->getReadmeTemplateContent('ENVIRONMENTS.md')), | ||
$this->callFileGetContent($this->generateResourcePath('md/readme/CREDENTIALS_AND_ACCESS.md'), $this->getReadmeTemplateContent('CREDENTIALS_AND_ACCESS.md')), | ||
$this->callFileGetContent($this->generateResourcePath('md/readme/RENOVATE.md'), $this->getReadmeTemplateContent('RENOVATE.md')), | ||
|
Copilot
AI
Oct 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty line contains trailing whitespace. Remove the whitespace to maintain code cleanliness.
Copilot uses AI. Check for mistakes.
$this->callFileGetContent($this->generateResourcePath('md/readme/CONTACTS.md'), $this->getReadmeTemplateContent('CONTACTS.md')), | ||
$this->callFileGetContent($this->generateResourcePath('md/readme/ENVIRONMENTS.md'), $this->getReadmeTemplateContent('ENVIRONMENTS.md')), | ||
$this->callFileGetContent($this->generateResourcePath('md/readme/CREDENTIALS_AND_ACCESS.md'), $this->getReadmeTemplateContent('CREDENTIALS_AND_ACCESS.md')), | ||
|
Copilot
AI
Oct 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty line contains trailing whitespace. Remove the whitespace to maintain code cleanliness.
Copilot uses AI. Check for mistakes.
$this->callFileGetContent($this->generateResourcePath('md/readme/CREDENTIALS_AND_ACCESS.md'), $this->getReadmeTemplateContent('CREDENTIALS_AND_ACCESS.md')), | ||
$this->callFileGetContent($this->generateResourcePath('md/readme/CLERK.md'), $this->getReadmeTemplateContent('CLERK.md')), | ||
$this->callFileGetContent($this->generateResourcePath('md/readme/RENOVATE.md'), $this->getReadmeTemplateContent('RENOVATE.md')), | ||
|
Copilot
AI
Oct 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Empty line contains trailing whitespace. Remove the whitespace to maintain code cleanliness.
Copilot uses AI. Check for mistakes.
} | ||
|
||
protected function addArrayItemIfMissing(array &$data, string $path, string $value): void | ||
protected function updateEnvFile(): void |
Copilot
AI
Oct 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line contains trailing whitespace after the function signature. Remove the trailing space.
protected function updateEnvFile(): void | |
protected function updateEnvFile(): void |
Copilot uses AI. Check for mistakes.
Refs: #67