Skip to content
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

Selective distinct/combine merge strategy. #22

Merged
merged 7 commits into from
Aug 7, 2018
Prev Previous commit
Next Next commit
Rename method
  • Loading branch information
greg-1-anderson committed Aug 7, 2018
commit 4accc3385cd3a1a65ee0ce580419ee5fe28c49bc
8 changes: 7 additions & 1 deletion src/Loader/ConfigProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ public function __construct($expander = null)
$this->expander = $expander ?: new Expander();
}

public function selectMergeStrategy($itemName)
/**
* By default, string config items always REPLACE, not MERGE when added
* from different sources. This method will allow applications to alter
* this behavior for specific items so that strings from multiple sources
* will be merged together into an array instead.
*/
public function useMergeStrategyForKeys($itemName)
{
if (is_array($itemName)) {
$this->nameOfItemsToMerge = array_merge($this->nameOfItemsToMerge, $itemName);
Expand Down