Skip to content

Commit

Permalink
Incorrect usage of array_filter
Browse files Browse the repository at this point in the history
  • Loading branch information
dtdesign committed Dec 24, 2019
1 parent ca47cee commit 1c09f7b
Showing 1 changed file with 4 additions and 4 deletions.
Expand Up @@ -568,14 +568,14 @@ protected function savePackageUpdates(array &$allNewPackages, $packageUpdateServ
$excludeCore60 = '6.0.0 Alpha 1';

$coreExclude = null;
$versionData['excludedPackages'] = array_filter($versionData['excludedPackages'], function($excludedPackage) use (&$coreExclude) {
if ($excludedPackage['excludedPackage'] === 'com.woltlab.wcf') {
$coreExclude = $excludedPackage['excludedPackageVersion'];
$versionData['excludedPackages'] = array_filter($versionData['excludedPackages'], function($excludedPackage, $excludedVersion) use (&$coreExclude) {
if ($excludedPackage === 'com.woltlab.wcf') {
$coreExclude = $excludedVersion;
return false;
}

return true;
});
}, ARRAY_FILTER_USE_BOTH);

if ($coreExclude === null || Package::compareVersion($coreExclude, $excludeCore60, '>')) {
$versionData['excludedPackages'][] = [
Expand Down

0 comments on commit 1c09f7b

Please sign in to comment.