Skip to content

Commit

Permalink
Fix InformationOperation breaking on latest Composer 2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek authored Oct 13, 2020
1 parent 5c71110 commit bcb853a
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/InformationOperation.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,18 @@

namespace Symfony\Flex;

use Composer\DependencyResolver\Operation\SolverOperation;
use Composer\DependencyResolver\Operation\OperationInterface;
use Composer\Package\PackageInterface;

/**
* @author Maxime Hélias <[email protected]>
*/
class InformationOperation extends SolverOperation
class InformationOperation implements OperationInterface
{
private $package;

public function __construct(PackageInterface $package, $reason = null)
public function __construct(PackageInterface $package)
{
parent::__construct($reason);

$this->package = $package;
}

Expand Down Expand Up @@ -62,4 +60,12 @@ public function __toString()
{
return $this->show(false);
}

/**
* Compatibility for Composer 1.x, not needed in Composer 2
*/
public function getReason()
{
return null;
}
}

0 comments on commit bcb853a

Please sign in to comment.