Fixed multiple ExecutionPolicies from populating the configuration file
This commit is contained in:
parent
84e4158fb8
commit
00e9bf1dd9
1 changed files with 7 additions and 3 deletions
|
@ -165,11 +165,15 @@
|
|||
*/
|
||||
public function addExecutionPolicy(ExecutionPolicy $policy, bool $overwrite=true): void
|
||||
{
|
||||
if(!$overwrite)
|
||||
foreach($this->execution_policies as $execution_policy)
|
||||
{
|
||||
foreach($this->execution_policies as $executionPolicy)
|
||||
if($execution_policy->getName() === $policy->getName())
|
||||
{
|
||||
if($executionPolicy->getName() === $policy->getName())
|
||||
if($overwrite)
|
||||
{
|
||||
$this->removeExecutionPolicy($execution_policy->getName());
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ConfigurationException('An execution policy with the name \'' . $policy->getName() . '\' already exists');
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue