本文整理汇总了PHP中Composer\Package\Version\VersionParser::parseLinks方法的典型用法代码示例。如果您正苦于以下问题:PHP VersionParser::parseLinks方法的具体用法?PHP VersionParser::parseLinks怎么用?PHP VersionParser::parseLinks使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Composer\Package\Version\VersionParser
的用法示例。
在下文中一共展示了VersionParser::parseLinks方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPlatformRequirements
public function getPlatformRequirements($withDevReqs = false)
{
$lockData = $this->getLockData();
$versionParser = new VersionParser();
$requirements = array();
if (!empty($lockData['platform'])) {
$requirements = $versionParser->parseLinks('__ROOT__', '1.0.0', 'requires', isset($lockData['platform']) ? $lockData['platform'] : array());
}
if ($withDevReqs && !empty($lockData['platform-dev'])) {
$devRequirements = $versionParser->parseLinks('__ROOT__', '1.0.0', 'requires', isset($lockData['platform-dev']) ? $lockData['platform-dev'] : array());
$requirements = array_merge($requirements, $devRequirements);
}
return $requirements;
}
示例2: testPluginApiVersionDoesSupportSelfVersion
public function testPluginApiVersionDoesSupportSelfVersion()
{
$parser = new VersionParser();
/** @var Link[] $links */
$links = $parser->parseLinks('Plugin', '6.6.6', '', array('composer-plugin-api' => 'self.version'));
$this->assertArrayHasKey('composer-plugin-api', $links);
$this->assertSame('6.6.6', $links['composer-plugin-api']->getConstraint()->getPrettyString());
}
示例3: init
protected function init(array $requires = array(), $minimumStability = 'stable')
{
$parser = new VersionParser();
$linkRequires = $parser->parseLinks('__ROOT__', '1.0.0', 'requires', $requires);
$this->package->expects($this->any())
->method('getRequires')
->will($this->returnValue($linkRequires));
$this->package->expects($this->any())
->method('getDevRequires')
->will($this->returnValue(array()));
$this->package->expects($this->any())
->method('getMinimumStability')
->will($this->returnValue($minimumStability));
/* @var RootPackageInterface $package */
$package = $this->package;
$this->filter = new VcsPackageFilter($package);
}