Skip to content

Commit

Permalink
bug #693 Fix InformationOperation breaking on latest Composer 2.x (Se…
Browse files Browse the repository at this point in the history
…ldaek)

This PR was merged into the 1.8-dev branch.

Discussion
----------

Fix InformationOperation breaking on latest Composer 2.x

See composer/composer@09ef026

Commits
-------

1ae060d Fix InformationOperation breaking on latest Composer 2.x
  • Loading branch information
nicolas-grekas committed Oct 13, 2020
2 parents 5c71110 + 1ae060d commit 5e980cc
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 5e980cc

Please sign in to comment.