Skip to content

Commit 3c9c342

Browse files
committed
bug #976 Avoid errors with an older global install of Flex (weaverryan)
This PR was merged into the 2.x branch. Discussion ---------- Avoid errors with an older global install of Flex Hi! When I tried 2.3.0 locally, I it exploded, complaining about: > Call to undefined method Symfony\Flex\Configurator::postInstall() The reason is that I have a global `symfony/flex` install, which was NOT on 2.3.0. And so... I guess (?) your global `symfony/flex` is used when originally creating a new project / installing `symfony/flex` into a project... at least partially? It's a bit opaque to me, but this may be needed to avoid issues. Btw, the fix for this is running `composer global up symfony/flex`. Commits ------- 2245d8b Avoid errors with an older global install of Flex
2 parents 68756d1 + 2245d8b commit 3c9c342

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/Flex.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -446,10 +446,12 @@ function ($value) {
446446
}
447447
}
448448

449-
foreach ($postInstallRecipes as $recipe) {
450-
$this->configurator->postInstall($recipe, $this->lock, [
451-
'force' => $event instanceof UpdateEvent && $event->force(),
452-
]);
449+
if (method_exists($this->configurator, 'postInstall')) {
450+
foreach ($postInstallRecipes as $recipe) {
451+
$this->configurator->postInstall($recipe, $this->lock, [
452+
'force' => $event instanceof UpdateEvent && $event->force(),
453+
]);
454+
}
453455
}
454456

455457
if (null !== $manifest) {

0 commit comments

Comments
 (0)