Skip to content

Commit b4eb22d

Browse files
rosierfabpot
authored andcommitted
Fix errors during the upgrade or downgrade of symfony/flex
1 parent 4d7970f commit b4eb22d

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

src/Command/GenerateIdCommand.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818

1919
class GenerateIdCommand extends Command
2020
{
21+
public function __construct(/* cannot be type-hinted */ $flex = null)
22+
{
23+
// No-op to support downgrading to v1.12.x
24+
25+
parent::__construct();
26+
}
27+
2128
protected function configure()
2229
{
2330
$this->setName('symfony:generate-id');

src/Downloader.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ public function getSessionId(): string
5959
return $this->sess;
6060
}
6161

62+
public function setFlexId(string $id = null)
63+
{
64+
// No-op to support downgrading to v1.12.x
65+
}
66+
6267
public function isEnabled()
6368
{
6469
return $this->enabled;

src/Flex.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,9 @@ class_exists(__NAMESPACE__.str_replace('/', '\\', substr($file, \strlen(__DIR__)
275275
$app->add(new Command\UnpackCommand($resolver));
276276
$app->add(new Command\RecipesCommand($this, $this->lock, $rfs));
277277
$app->add(new Command\InstallRecipesCommand($this, $this->options->get('root-dir')));
278-
$app->add(new Command\GenerateIdCommand());
278+
if (class_exists(Command\GenerateIdCommand::class)) {
279+
$app->add(new Command\GenerateIdCommand(null));
280+
}
279281
$app->add(new Command\DumpEnvCommand($this->config, $this->options));
280282

281283
break;

0 commit comments

Comments
 (0)