Skip to content

Commit

Permalink
Merge pull request #2266 from cron-eu/4.3-composer-v2
Browse files Browse the repository at this point in the history
BUGFIX: Make InstallerScripts compatible to composer version 2.0+
  • Loading branch information
kdambekalns authored Nov 21, 2020
2 parents 303733e + 6aba3d4 commit 862a0a2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Neos.Flow/Classes/Composer/InstallerScripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static function postPackageUpdateAndInstall(PackageEvent $event)
if (!$operation instanceof InstallOperation && !$operation instanceof UpdateOperation) {
throw new Exception\UnexpectedOperationException('Handling of operation with type "' . $operation->getJobType() . '" not supported', 1348750840);
}
$package = ($operation->getJobType() === 'install') ? $operation->getPackage() : $operation->getTargetPackage();
$package = ($operation instanceof InstallOperation) ? $operation->getPackage() : $operation->getTargetPackage();
$packageExtraConfig = $package->getExtra();
$installPath = $event->getComposer()->getInstallationManager()->getInstallPath($package);

Expand All @@ -80,7 +80,7 @@ public static function postPackageUpdateAndInstall(PackageEvent $event)
$evaluatedInstallerResources = true;
}

if ($operation->getJobType() === 'install') {
if ($operation instanceof InstallOperation) {
if (isset($packageExtraConfig['typo3/flow']['post-install'])) {
self::runPackageScripts($packageExtraConfig['typo3/flow']['post-install']);
}
Expand All @@ -89,7 +89,7 @@ public static function postPackageUpdateAndInstall(PackageEvent $event)
}
}

if ($operation->getJobType() === 'update') {
if ($operation instanceof UpdateOperation) {
if (isset($packageExtraConfig['typo3/flow']['post-update'])) {
self::runPackageScripts($packageExtraConfig['typo3/flow']['post-update']);
}
Expand Down

0 comments on commit 862a0a2

Please sign in to comment.