Skip to content

Commit

Permalink
Fix some weird behaviour with messing up the ArrayObject that's insid…
Browse files Browse the repository at this point in the history
…e the wrapper.
  • Loading branch information
yunosh committed Oct 24, 2021
1 parent cc4c916 commit a208849
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions lib/Components/Helper/ChangeLog.php
Expand Up @@ -132,20 +132,15 @@ public function setVersion($version, $api)
$oldVersion = $hordeInfo['version']['release'];
$changelog = $this->_component->getWrapper('ChangelogYml');
$newChangelog = array();
array_walk(
$changelog,
function($entry, $ver)
use (&$newChangelog, $oldVersion, $version, $api)
{
if ($ver == $oldVersion) {
$ver = $version;
if ($api) {
$entry['api'] = $api;
}
foreach ($changelog as $ver => $entry) {
if ($ver == $oldVersion) {
$ver = $version;
if ($api) {
$entry['api'] = $api;
}
$newChangelog[$ver] = $entry;
}
);
$newChangelog[$ver] = $entry;
}
$changelog->exchangeArray($newChangelog);
}

Expand Down

0 comments on commit a208849

Please sign in to comment.