Allow Semver VersionParser in input hints
parent
c9436438ff
commit
fff0aed3a6
|
@ -18,6 +18,7 @@ use Composer\Package\Link;
|
||||||
use Composer\Package\RootAliasPackage;
|
use Composer\Package\RootAliasPackage;
|
||||||
use Composer\Package\RootPackageInterface;
|
use Composer\Package\RootPackageInterface;
|
||||||
use Composer\Package\Version\VersionParser;
|
use Composer\Package\Version\VersionParser;
|
||||||
|
use Composer\Semver\VersionParser as SemverVersionParser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Konstantin Kudryashiv <ever.zet@gmail.com>
|
* @author Konstantin Kudryashiv <ever.zet@gmail.com>
|
||||||
|
@ -28,7 +29,7 @@ class ArrayLoader implements LoaderInterface
|
||||||
protected $versionParser;
|
protected $versionParser;
|
||||||
protected $loadOptions;
|
protected $loadOptions;
|
||||||
|
|
||||||
public function __construct(VersionParser $parser = null, $loadOptions = false)
|
public function __construct(SemverVersionParser $parser = null, $loadOptions = false)
|
||||||
{
|
{
|
||||||
if (!$parser) {
|
if (!$parser) {
|
||||||
$parser = new VersionParser;
|
$parser = new VersionParser;
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace Composer\Package\Version;
|
||||||
use Composer\Config;
|
use Composer\Config;
|
||||||
use Composer\Repository\Vcs\HgDriver;
|
use Composer\Repository\Vcs\HgDriver;
|
||||||
use Composer\IO\NullIO;
|
use Composer\IO\NullIO;
|
||||||
use Composer\Package\Version\VersionParser;
|
use Composer\Semver\VersionParser as SemverVersionParser;
|
||||||
use Composer\Util\Git as GitUtil;
|
use Composer\Util\Git as GitUtil;
|
||||||
use Composer\Util\ProcessExecutor;
|
use Composer\Util\ProcessExecutor;
|
||||||
use Composer\Util\Svn as SvnUtil;
|
use Composer\Util\Svn as SvnUtil;
|
||||||
|
@ -39,16 +39,16 @@ class VersionGuesser
|
||||||
private $process;
|
private $process;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var VersionParser
|
* @var SemverVersionParser
|
||||||
*/
|
*/
|
||||||
private $versionParser;
|
private $versionParser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Config $config
|
* @param Config $config
|
||||||
* @param ProcessExecutor $process
|
* @param ProcessExecutor $process
|
||||||
* @param VersionParser $versionParser
|
* @param SemverVersionParser $versionParser
|
||||||
*/
|
*/
|
||||||
public function __construct(Config $config, ProcessExecutor $process, VersionParser $versionParser)
|
public function __construct(Config $config, ProcessExecutor $process, SemverVersionParser $versionParser)
|
||||||
{
|
{
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
$this->process = $process;
|
$this->process = $process;
|
||||||
|
|
|
@ -17,7 +17,6 @@ use Composer\Package\BasePackage;
|
||||||
use Composer\Package\PackageInterface;
|
use Composer\Package\PackageInterface;
|
||||||
use Composer\Package\Loader\ArrayLoader;
|
use Composer\Package\Loader\ArrayLoader;
|
||||||
use Composer\Package\Dumper\ArrayDumper;
|
use Composer\Package\Dumper\ArrayDumper;
|
||||||
use Composer\Package\Version\VersionParser;
|
|
||||||
use Composer\Semver\Semver;
|
use Composer\Semver\Semver;
|
||||||
use Composer\Semver\Constraint\Constraint;
|
use Composer\Semver\Constraint\Constraint;
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
namespace Composer\Repository;
|
namespace Composer\Repository;
|
||||||
|
|
||||||
use Composer\IO\IOInterface;
|
use Composer\IO\IOInterface;
|
||||||
|
use Composer\Semver\VersionParser as SemverVersionParser;
|
||||||
use Composer\Package\Version\VersionParser;
|
use Composer\Package\Version\VersionParser;
|
||||||
use Composer\Repository\Pear\ChannelReader;
|
use Composer\Repository\Pear\ChannelReader;
|
||||||
use Composer\Package\CompletePackage;
|
use Composer\Package\CompletePackage;
|
||||||
|
@ -94,10 +95,10 @@ class PearRepository extends ArrayRepository implements ConfigurableRepositoryIn
|
||||||
* Builds CompletePackages from PEAR package definition data.
|
* Builds CompletePackages from PEAR package definition data.
|
||||||
*
|
*
|
||||||
* @param ChannelInfo $channelInfo
|
* @param ChannelInfo $channelInfo
|
||||||
* @param VersionParser $versionParser
|
* @param SemverVersionParser $versionParser
|
||||||
* @return CompletePackage
|
* @return CompletePackage
|
||||||
*/
|
*/
|
||||||
private function buildComposerPackages(ChannelInfo $channelInfo, VersionParser $versionParser)
|
private function buildComposerPackages(ChannelInfo $channelInfo, SemverVersionParser $versionParser)
|
||||||
{
|
{
|
||||||
$result = array();
|
$result = array();
|
||||||
foreach ($channelInfo->getPackages() as $packageDefinition) {
|
foreach ($channelInfo->getPackages() as $packageDefinition) {
|
||||||
|
|
Loading…
Reference in New Issue