Skip to content

Commit

Permalink
Merge pull request #221 from lemberg/issue/218-phpcs
Browse files Browse the repository at this point in the history
Address newly introduced PHPCS errors/warnings
  • Loading branch information
T2L committed Sep 24, 2020
2 parents b4a7945 + 306df42 commit 289c9b0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Draft Environment (Unreleased)

Fixes:

- [GH-218](https://github.com/lemberg/draft-environment/issues/218) - Address newly introduced PHPCS errors/warnings

## Draft Environment 3.2.0, 2020-08-21

Updates:
Expand Down
12 changes: 10 additions & 2 deletions src/Config/Install/Step/InitConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,16 @@ public function uninstall(): void {
// Clean up .gitignore.
$targetGitIgnore = $configObject->getTargetConfigFilepath(Config::TARGET_GITIGNORE);
$gitIgnoreContent = $fs->loadFile('.gitignore', $targetGitIgnore);
$gitIgnoreContent = str_replace([self::GITIGNORE_VAGRANT_LINE, trim(self::GITIGNORE_VAGRANT_LINE)], '', $gitIgnoreContent);
$gitIgnoreContent = str_replace([self::GITIGNORE_TARGET_LOCAL_CONFIG_FILENAME_LINE, trim(self::GITIGNORE_TARGET_LOCAL_CONFIG_FILENAME_LINE)], '', $gitIgnoreContent);
$search = [
self::GITIGNORE_VAGRANT_LINE,
trim(self::GITIGNORE_VAGRANT_LINE),
];
$gitIgnoreContent = str_replace($search, '', $gitIgnoreContent);
$search = [
self::GITIGNORE_TARGET_LOCAL_CONFIG_FILENAME_LINE,
trim(self::GITIGNORE_TARGET_LOCAL_CONFIG_FILENAME_LINE),
];
$gitIgnoreContent = str_replace($search, '', $gitIgnoreContent);

// Check if those where the only lines in the .gitignore.
if (preg_replace('/\R+/m', '', $gitIgnoreContent) === '') {
Expand Down
4 changes: 3 additions & 1 deletion src/Config/Install/Step/ProjectName.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ public function install(array &$config): void {
> Project name <question>[$default]</question>:
HERE;

$config['vagrant']['hostname'] = $this->io->askAndValidate($question, [__CLASS__, 'validateProjectName'], NULL, $default);
$config['vagrant']['hostname'] = $this->io->askAndValidate(
$question, [__CLASS__, 'validateProjectName'], NULL, $default
);
}

/**
Expand Down

0 comments on commit 289c9b0

Please sign in to comment.