Skip to content

Commit

Permalink
Explicitly add the default profile to the list of mutators (#507)
Browse files Browse the repository at this point in the history
As even if the list is seemingly empty by default, it is not.
If it would actually contain the default profile by default,
it would make the profiles feature more obvious to configure.

Right now it is not immediately obvious from the documentation
that one has to add the default profile to the list, you have
to actually read what is written. With this small change a user
could start adding and changing mutators right away, just after
skimming the example configuration provided.
  • Loading branch information
sanmai authored and maks-rafalko committed Oct 16, 2018
1 parent 1408225 commit 68f70ad
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Command/ConfigureCommand.php
Expand Up @@ -164,6 +164,15 @@ private function saveConfig(
$configObject->logs->text = $textLogFilePath;
}

/*
* Explicitly add the default profile to the list of mutators, as even if it is
* empty by default, it is not. If it would actually contain the default profile
* by default, it would make the profiles feature more obvious to configure.
*/
$configObject->mutators = [
'@default' => true,
];

file_put_contents(InfectionConfig::CONFIG_FILE_NAME . '.dist', json_encode($configObject, JSON_PRETTY_PRINT));
}
}
3 changes: 3 additions & 0 deletions tests/Fixtures/e2e/Configure/infection.json.test
Expand Up @@ -7,5 +7,8 @@
},
"logs": {
"text": "infection.log"
},
"mutators": {
"@default": true
}
}

0 comments on commit 68f70ad

Please sign in to comment.