rename baseversionparser to semverversionparser
and fix docblock as per @stof requestpull/4446/head
parent
89717fa593
commit
1328d9c3b2
|
@ -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\Semver\VersionParser as BaseVersionParser;
|
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,7 +39,7 @@ class VersionGuesser
|
||||||
private $process;
|
private $process;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var BaseVersionParser
|
* @var SemverVersionParser
|
||||||
*/
|
*/
|
||||||
private $versionParser;
|
private $versionParser;
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ class VersionGuesser
|
||||||
* @param ProcessExecutor $process
|
* @param ProcessExecutor $process
|
||||||
* @param VersionParser $versionParser
|
* @param VersionParser $versionParser
|
||||||
*/
|
*/
|
||||||
public function __construct(Config $config, ProcessExecutor $process, BaseVersionParser $versionParser)
|
public function __construct(Config $config, ProcessExecutor $process, SemverVersionParser $versionParser)
|
||||||
{
|
{
|
||||||
$this->config = $config;
|
$this->config = $config;
|
||||||
$this->process = $process;
|
$this->process = $process;
|
||||||
|
|
|
@ -12,14 +12,19 @@
|
||||||
|
|
||||||
namespace Composer\Package\Version;
|
namespace Composer\Package\Version;
|
||||||
|
|
||||||
use Composer\Semver\VersionParser as BaseVersionParser;
|
use Composer\Semver\VersionParser as SemverVersionParser;
|
||||||
|
|
||||||
class VersionParser extends BaseVersionParser
|
class VersionParser extends SemverVersionParser
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param array $pairs
|
* Parses an array of strings representing package/version pairs.
|
||||||
*
|
*
|
||||||
* @return array[]
|
* The parsing results in an array of arrays, each of which
|
||||||
|
* contain a 'name' key with value and optionally a 'version' key with value.
|
||||||
|
*
|
||||||
|
* @param array $pairs a set of package/version pairs separated by ":", "=" or " "
|
||||||
|
*
|
||||||
|
* @return array[] array of arrays containing a name and (if provided) a version
|
||||||
*/
|
*/
|
||||||
public function parseNameVersionPairs(array $pairs)
|
public function parseNameVersionPairs(array $pairs)
|
||||||
{
|
{
|
||||||
|
|
|
@ -16,7 +16,7 @@ use Composer\DependencyResolver\Pool;
|
||||||
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\Semver\VersionParser as BaseVersionParser;
|
use Composer\Semver\VersionParser as SemverVersionParser;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Selects the best possible version for a package
|
* Selects the best possible version for a package
|
||||||
|
@ -131,7 +131,7 @@ class VersionSelector
|
||||||
private function getParser()
|
private function getParser()
|
||||||
{
|
{
|
||||||
if ($this->parser === null) {
|
if ($this->parser === null) {
|
||||||
$this->parser = new BaseVersionParser();
|
$this->parser = new SemverVersionParser();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->parser;
|
return $this->parser;
|
||||||
|
|
Loading…
Reference in New Issue