1
0
Fork 0

Fix type issues with root package interface

pull/9873/head
Jordi Boggiano 2021-05-04 16:47:54 +02:00
parent 22cc96682d
commit 649087d6de
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
4 changed files with 82 additions and 22 deletions

View File

@ -17,7 +17,6 @@ use Composer\DependencyResolver\Request;
use Composer\Installer;
use Composer\IO\IOInterface;
use Composer\Package\Loader\RootPackageLoader;
use Composer\Package\RootPackage;
use Composer\Plugin\CommandEvent;
use Composer\Plugin\PluginEvents;
use Composer\Package\Version\VersionParser;
@ -156,9 +155,7 @@ EOT
}
$rootPackage->setRequires($rootRequires);
$rootPackage->setDevRequires($rootDevRequires);
if ($rootPackage instanceof RootPackage) {
$rootPackage->setReferences(RootPackageLoader::extractReferences($reqs, $rootPackage->getReferences()));
}
$rootPackage->setReferences(RootPackageLoader::extractReferences($reqs, $rootPackage->getReferences()));
$rootPackage->setStabilityFlags(RootPackageLoader::extractStabilityFlags($reqs, $rootPackage->getMinimumStability(), $rootPackage->getStabilityFlags()));
if ($input->getOption('interactive')) {

View File

@ -159,6 +159,46 @@ class RootAliasPackage extends CompleteAliasPackage implements RootPackageInterf
$this->aliasOf->setStabilityFlags($stabilityFlags);
}
/**
* {@inheritDoc}
*/
public function setMinimumStability($minimumStability)
{
$this->aliasOf->setMinimumStability($minimumStability);
}
/**
* {@inheritDoc}
*/
public function setPreferStable($preferStable)
{
$this->aliasOf->setPreferStable($preferStable);
}
/**
* {@inheritDoc}
*/
public function setConfig(array $config)
{
$this->aliasOf->setConfig($config);
}
/**
* {@inheritDoc}
*/
public function setReferences(array $references)
{
$this->aliasOf->setReferences($references);
}
/**
* {@inheritDoc}
*/
public function setAliases(array $aliases)
{
$this->aliasOf->setAliases($aliases);
}
/**
* {@inheritDoc}
*/

View File

@ -29,9 +29,7 @@ class RootPackage extends CompletePackage implements RootPackageInterface
protected $aliases = array();
/**
* Set the minimumStability
*
* @param string $minimumStability
* {@inerhitDoc}
*/
public function setMinimumStability($minimumStability)
{
@ -47,9 +45,7 @@ class RootPackage extends CompletePackage implements RootPackageInterface
}
/**
* Set the stabilityFlags
*
* @param array $stabilityFlags
* {@inheritDoc}
*/
public function setStabilityFlags(array $stabilityFlags)
{
@ -65,9 +61,7 @@ class RootPackage extends CompletePackage implements RootPackageInterface
}
/**
* Set the preferStable
*
* @param bool $preferStable
* {@inerhitDoc}
*/
public function setPreferStable($preferStable)
{
@ -83,9 +77,7 @@ class RootPackage extends CompletePackage implements RootPackageInterface
}
/**
* Set the config
*
* @param array $config
* {@inerhitDoc}
*/
public function setConfig(array $config)
{
@ -101,9 +93,7 @@ class RootPackage extends CompletePackage implements RootPackageInterface
}
/**
* Set the references
*
* @param array $references
* {@inerhitDoc}
*/
public function setReferences(array $references)
{
@ -119,9 +109,7 @@ class RootPackage extends CompletePackage implements RootPackageInterface
}
/**
* Set the aliases
*
* @param array $aliases
* {@inerhitDoc}
*/
public function setAliases(array $aliases)
{

View File

@ -128,6 +128,41 @@ interface RootPackageInterface extends CompletePackageInterface
*/
public function setStabilityFlags(array $stabilityFlags);
/**
* Set the minimumStability
*
* @param string $minimumStability
*/
public function setMinimumStability($minimumStability);
/**
* Set the preferStable
*
* @param bool $preferStable
*/
public function setPreferStable($preferStable);
/**
* Set the config
*
* @param array $config
*/
public function setConfig(array $config);
/**
* Set the references
*
* @param array $references
*/
public function setReferences(array $references);
/**
* Set the aliases
*
* @param array $aliases
*/
public function setAliases(array $aliases);
/**
* Set the suggested packages
*